Since ancient times, the monks of Lucas' Tower have honored their most cryptic tradition, solving the following mathematical puzzle : Given a stack of n disks arranged from largest on the bottom to smallest on top placed on a rod, together with two empty rods, the towers of Hanoi puzzle asks for the minimum number of moves required to move the stack from one rod to another, where moves are allowed only if they place smaller disks on top of larger disks.
Input Format
An integer x representing the number of disks on the first rod, such that 0 < x < 30
Sample Input
3
Output Format A single integer representing the minimum number of moves required to move the entire set of disks on to a new rod.
Sample Output
7
You must be logged in to submit a solution.