The money has to come from outside Brazil and be registered with the Central Bank as foreign investment. Funds already held in Brazil generally do not count.