cho.sh
Notes
Loading...

Tiling a 3-by-N Wall

Time limit

2s

Memory limit

128 MB

Problem

There is a rectangular wall with height 3 and width NNN. You want to cover the entire wall with domino tiles of size 2×12\times12×1 or 1×21\times21×2.

Tiles must not overlap, and no tile may extend outside the wall. Find the number of different ways to tile the wall.

Input

The first line contains an integer NNN. (1≤N≤30)(1 \le N \le 30)(1≤N≤30)

Output

Print the number of ways to tile a 3×N3\times N3×N wall.

Hint

The figure below shows one tiling of a 3×123\times123×12 wall.