A little monkey had some peaches. On the first day he decided to keep ½ of his peaches. He gave the rest away. Then he ate one. On the second day he decided to keep ½ of his peaches. He gave the rest away then he ate one. On the third day he decided to keep ½ of his peaches. He gave the rest away. Then he ate one. On the fourth day, he found he had only one peach left. How many did he have at the beginning?