Practice on Toph

Participate in exhilarating programming contests, solve unique algorithm and data structure challenges and be a part of an awesome community.

Fibonacci Numbers

Limits 1s, 512 MB

Given an integer $N$, print the $N$-th Fibonacci number.

A Fibonacci series is a series of numbers in which each number is the sum of the two numbers preceding it. For this problem, you can assume that the first two numbers in the series are 1 and 1.

Below you can see the first few numbers of the series:

1, 1, 2, 3, 5, 8, ...

Input

The input will contain an integer $N$ ($0 < N < 50$).

Output

Print the $N$-th Fibonacci number.

Sample

InputOutput
3
2

Discussion

Statistics


97% Solution Ratio

ShahedHossenEarliest, Nov '18

ShahedHossenFastest, 0.0s

CCS_RUSHIKONLightest, 0 B

n4o847Shortest, 35B

Submit

Login to submit