#K76337. Tree Growth Calculation
Tree Growth Calculation
Tree Growth Calculation
You are given an integer (N) representing the number of years a tree grows. Initially, the tree has a height of 1. In each subsequent year (i) (where (1 \leq i \leq N)), the tree's height increases by (2^{i-1}). Thus, after (N) years, the height of the tree can be computed as: [ H = 1 + \sum_{i=0}^{N-1} 2^i = 2^N]
For example:
- For \(N = 0\), the height is 1.
- For \(N = 1\), the height is 2.
- For \(N = 3\), the height is 8.
- For \(N = 5\), the height is 32.
inputFormat
The input consists of a single integer (N) ((0 \leq N \leq 50)) provided through standard input.
outputFormat
Output a single integer which is the height of the tree after (N) years. The output should be printed to standard output.## sample
0
1