Fibonacci Sequence

4

3 votes
Problem

The BT gang is always partying in some room or the other. To gain entry into the room, one needs to know the fibonacci sequence.

The first ten terms of the fibonacci sequence are:

0, 1, 1, 2, 3, 5, 8, 13, 21, 34, ... and so on. (Each term is the sum of previous two terms)

You have to tell the n'th term of the sequence.
Input :

A single integer n.

Output :

The n'th term in the fibonacci sequence. Print a \n at the end of the answer.

Constraints :

1<=n<=15

Time Limit: 1
Memory Limit: 256
Source Limit:
Explanation

The 5th term of the fibonacci sequence is 3 (As seen above).

Editor Image

?