P5743 [Deep Basis 7. Exercise 8] Monkey Eating Peaches

Description

A little monkey bought some peaches. On the first day, it ate exactly half of the peaches, and then, being greedy, ate one more. On each following day, it eats half of the remaining peaches plus one more. On the morning of day $n$, it finds that only $1$ peach is left. How many peaches did the monkey buy?

Input Format

Input one positive integer $n$, representing the number of days.

Output Format

Output how many peaches the monkey bought.

Explanation/Hint

Constraints: $1\le n\le20$. Translated by ChatGPT 5