A Temple has four sides to go in means1000 staircases from all sides if a man climbs the temple from one sides and then puts 5 rupees on each stair case and went in the temple and puts 500 in the temple and if he does the same thing with the three sides also . then the rupees left with him are 1000 . How many rupees does the man have total ?