From a number of apples, a man sells half the number of existing apples plus 1 to the first customer, sells half of the remaining apples plus 1 to the second customer and half of the remaining apples plus 1, he sells to the third customer. He then finds he has nothing left. How many apples did he have originally?