From the above figure, the number of nodes for the first three depths are 3, 9, and 27.
You will be given a number N. Your task is to find out the total number of nodes within the first N depth.
Enter a single integer, N, where 0 ≤ N ≤ 30.
Print the answer for the mentioned problem.
Input | Output |
---|---|
2 | 13 |
Input | Output |
---|---|
3 | 40 |