Problem1067--Climb the stair 2

1067: Climb the stair 2

[Creator : ]
Time Limit : 1.000 sec  Memory Limit : 128 MiB

Description

Given a staircase of N steps and you can either climb 1 , 2  or 3 steps at a given time, however, you are not allowed to climb more than 2 of "3 steps" consecutive. The task is to return the count of distinct ways to climb to the top.

Input

One integer N   (1 <= N <= 20 )

Output

One integer which is the number of ways to climb to the top.

Sample Input Copy

9

Sample Output Copy

148

Source/Category