#include <iostream>
using namespace std;
int num(int n);
int main(){
  int n;cin >> n;
  cout << num(num(n)) <<endl;
}

int num(int n){
  if(n<1)return 0;
  if(n=1)return 1;
  return num(n-1)+num(n-2)+num(n-3);
}