The Sum


Submit solution

Points: 5
Time limit: 0.5s
Memory limit: 4M

Authors:
Problem type

time limit per test: 0.5 sec. memory limit per test: 4096 KB

The Fibonacci sequence of numbers is known: F1 = 1; F2 = 1; Fn+1 = Fn + Fn-1, for n>1. You have to find S - the sum of the first K Fibonacci numbers.

Input

First line contains natural number K (0<K<41).

Output

First line should contain number S.

Sample Input

    5

Sample Output

    12

Comments


  • 1
    CBENU4CSE18433  commented on June 13, 2019, 3:33 p.m.

    whats the logic


    • 0
      knn  commented on June 13, 2019, 11:40 p.m.

      you are not supposed to discuss the solutions in the comment section. Please restrict your queries to doubts regarding questions, i/o format alone.