#include <iostream>
using namespace std;

int rabbit(int one,int two,int three,int n){
    int tem;
    while(n--){
        three = three + two;
        two = one;
        one = three;
    }
    return one+two+three;
}

int main() {
    int n;
    while (cin >> n) { 
        cout<<rabbit(1, 0, 0, n-1)<<endl;
    }
}