Under construction

Still being built. Things may change

Fibonacci Number

Interview

Time limit1sMemory limit128 MB

Summary
Given n, print the n-th Fibonacci number, where the sequence starts 1, 1 and each later term is the sum of the previous two.
Level

Easy3 of 10

Topics
Dynamic programming, Math, Implementation, Recursion
Solved
No attempts yet

Problem

The Fibonacci sequence is built by adding the previous two terms to obtain the next one. Its first two terms are both 1.

f(1)=1,f(2)=1,f(n)=f(n−1)+f(n−2) (n>2)f(1) = 1, \quad f(2) = 1, \quad f(n) = f(n-1) + f(n-2)\ (n > 2)

Given an integer nn, write a program that prints the nn-th Fibonacci number f(n)f(n).

Input

The first line contains an integer nn (1≤n)(1 \le n). The input is always chosen so that f(n)f(n) has at most 1000 digits.

Output

Print the nn-th Fibonacci number f(n)f(n) on the first line.

Hint

Every answer in this problem has at most 1000 digits. For example, f(20)=6765f(20) = 6765, which has 4 digits.

Examples1

  1. Example 1

    Input
    100
    
    Expected output
    354224848179261915075