#include<bits/stdc++.h>
using namespace std;
int f(int i){
	if(i==3) return 4;
	if(i==2) return 2;
	if(i==1) return 1;
	else return f(i-1)+f(i-2)+f(i-3);
}
int main(){
	int n;
	cin>>n;
	cout<<f(n+1);
}
/**************************************************************
	Problem: 1689
	User: panyuchen
	Language: C++
	Result: Accepted
	Time:8 ms
	Memory:2072 kb
****************************************************************/