Mr X went shopping with a certain amount of money. He spent Rs. 10(¼) on buying a pen and Rs. 25(¾) in food. He then gave the remaining Rs. 16(½) to his friend. Calculate how much money he initially had.