eolymp
bolt
Try our new interface for solving problems
Problems

Fibonacci

Fibonacci

Fibonacci numbers is a sequence of numbers $f(n)$, defined by the formula: \begin{itemize} \item $f(0) = 1$, \item $f(1) = 1$, \item $f(n) = f(n - 1) + f(n - 2)$ \end{itemize} Given a value of $n$, find the $n$-th Fibonacci number. \InputFile One nonnegative integer $n~(n \le 45)$, representing the Fibonacci number to be printed. \OutputFile Print the $n$-th Fibonacci number.
Time limit 1 second
Memory limit 128 MiB
Input example #1
4
Output example #1
5