Problem list
Log in
#r03239 · Online Judge > GoldOJ

Nth Fibonacci

Bronze II 2.0 s 256 MB

The Fibonacci sequence is $1, 1, 2, 3, 5, 8, 13, \dots$ (the first two terms are $1$). Given $N$, print the $N$-th term.

Input

One integer $N$ ($1 \le N \le 40$).

Output

Print the $N$-th Fibonacci number.

Example 1

Input
7
Output
13
Source
Online Judge > GoldOJ
Appears in
Not part of a ladder, contest or set yet.
Accepted 0 Submissions 0 Acceptance 0% Solvers 0

Discussion

Threads about this problem. Spoilers are collapsed; wrap hints in ||double bars||.

No discussion yet. Start a thread if something here needs explaining.

Recent submissions Open with filters
Code