One person has some money in his pocket, He visits four temple on the way. As soon as he enters a temple, his money gets double and he offers Rs. 100 in each temple thus his pocket gets empty after he returns from the fourth temple. Now the question is how much money he had initially ?