p123.cpp
======================
#include <bits/stdc++.h>
#define endl '\n'

// #pragma GCC optimize ("O3")
// #pragma GCC target ("sse4")

using namespace std;
template<class T, class T2>
inline void chkmax(T& x, const T2& y) {
    if(x < y) {
        x = y;
    }
}
template<class T, class T2>
inline void chkmin(T& x, const T2& y) {
    if(x > y) {
        x = y;
    }
}
const int MAXN = (1 << 10);

int n;

void read() { cin >> n; }

int64_t f[MAXN], sum = 0;

void solve() {
    f[0] = f[1] = f[2] = 1;
    for(int i = 3; i <= n; i++) {
        f[i] = f[i - 1] + f[i - 2], sum += f[i];
    }

    if(n >= 1) {
        sum += 1;
    }
    if(n >= 2) {
        sum += 1;
    }

    cout << sum << endl;
}

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);

    read();
    solve();
    return 0;
}

=================
statement.txt
======================
123. The sum

time limit per test: 0.25 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
Author	: Paul "Stingray" Komkoff, Victor G. Samoilov
Resource	: 5th Southern Subregional Contest. Saratov 2002
Date	: 2002-10-10

=================
