Jessie was doing business in Ventura city, selling goods. His first sales in the morning doubled his money, and then he spent $12 for breakfast. Prior to noon, he again doubled his money but then spent $12 on lunch. His last sales in the evening once again doubled his money but then he spent his last $12 on dinner. How much money did he have at the beginning of the day?