#include<iostream>
#include<algorithm>
using namespace std;
int A[128],N;

int main(){
  A[0]=1;
  A[1]=1;
  A[2]=2;
  for(int i=3;i<=30;i++){
    A[i]=A[i-1]+A[i-2]+A[i-3];
  }
  while(cin >> N && N){
    cout << (A[N]+3649)/3650 << endl;
  }

}

