우측 버튼을 눌러 기기를 연결해주세요.
문제정보
Programming - Fibonacci Number
100

The goal is to sum up to the n-th term of the Fibonacci Number, a popular sequence in mathematics.

F0=0, F11=1, Fn+2n+2=Fn+1n+1+Fnn

We can define the Fibonacci sequence with the recurrence relation as above.

Based on the 0th term being 0 and the 1st term being 1, from the 2nd term, the number of the previous two is added.

Listed below is the outcome:

(0), 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233, 377 ... and so on.

Write a program to sum up to the n-th Fibonacci Number

Input

Natural number (less than 30)

Output

Sum of Fibonacci Sequence Terms from 1 to natural number Entered


입/출력 예시
:
공백
:
줄바꿈
:
예시 1
입력
10
출력
143
예시 2
입력
20
출력
17710
⋇ 입출력 형식을 잘 지켜주세요