Once, the king rewarded a farmer with an apple from his garden. The farmer went to the garden and saw that it was surrounded by fences. Each fence had only one gate, and at each gate stood a guard. The farmer approached the first guard and showed him the royal decree. The guard said: "Go ahead and take, but upon exit, give me half of the apples you carry, and one more." The same was said by the second, third guard, and so on. How many apples must the farmer take so that after paying all the guards, he is left with exactly one apple?
The only number — the number of fences in the garden (1 \leq n \leq 62).
The only number — the number of apples the farmer must take so that after paying all the guards, he has exactly one apple left.
Example 1
Example 2