#K73397. Count Ways to Reach the Top

    ID: 33966 Type: Default 1000ms 256MiB

Count Ways to Reach the Top

Count Ways to Reach the Top

You are given a staircase with N steps. You can climb the staircase by taking either one step or two steps at a time. Your task is to compute the number of unique ways to reach the top of the staircase.

The problem can be formulated using the recurrence relation:

dp[i]=dp[i1]+dp[i2]dp[i] = dp[i-1] + dp[i-2]

with the base cases:

dp[1]=1,dp[2]=2,dp[0]=0dp[1] = 1, \quad dp[2] = 2, \quad dp[0] = 0

Note: If N is less than or equal to 0, the answer is 0.

inputFormat

The input consists of a single integer N representing the number of steps in the staircase. The input is read from standard input (stdin).

outputFormat

Output a single integer representing the number of unique ways to reach the top of the staircase. The output should be printed to standard output (stdout).

## sample
3
3