#include<iostream>
using namespace std;
long long dp[30];

void tribonacci(int n){
    if (n==1) {
        dp[n-1] = 1;
    } else if (n==2) {
        dp[n-1] = 2;
    } else if (n==3) {
        dp[n-1] = 4;
    } else {
        dp[n-1] = dp[n-2] + dp[n-3] + dp[n-4];
    }
}

int main() {
    int n;
    cin >> n;
    for(int i=1;i<=n;i++) {
        tribonacci(i);
    }
    cout << dp[n-1] << endl;
    return 0;
}