A king announced to his subjects that "Whoever brings me two lemons from the magic garden, will be crowned as king."
One clever young man dared to go in search of the lemons. He came near the first door of the garden. The guard told the young man that "When you return you should give me half of the lemons you have with you. Half of the quantity means strict half, that is, if you bring 10, I should have 5 and you should have 5. If we have unequal amounts I will kill you. If you satisfy these conditions as a token of appreciation I will give you one lemon back."
He has to pass all 100 doors with guards with these same conditions.
On returning back he satisfied all the conditions of guards and gave the king the two lemons and became the king.
How many lemons did he pick?