THE GAMBLER
A gambler enters the casino three times. Each time he comes in he gives $10 to the doorman. Then he bets all of his remaining money. And he wins, doubling his original bet. As he goes out he gives another $10 to the high-roller. He does this three times in a row. By the third time, when he goes out, he has no more money left. How much money did he have originally, when he first entered the casino?