There are caterpillars in two greenhouses. Greenhouse A has 4 times the number of caterpillars Greenhouse B has. A bird came into the two greenhouses and devoured many caterpillars. After the bird ate 41 caterpillars in Greenhouse A and 5 caterpillars in Greenhouse B, both greenhouses have the same number of caterpillars. How many caterpillars did Greenhouse A have in the first place?