A fruit vendor brought a bag full of mangoes to the market. He kept some of the mangoes into the basket and put them for sale. He sold one-third of the mangoes in the basket to Mr. A and adds 18 more to it. He sold three-fourth of the remaining mangoes in the basket to Mr. B, and adds 12 more to it, after which he left with 25 mangoes in his basket. How many mangoes did the fruit vendor take in his basket in the beginning?