#include<bits/stdc++.h>
using namespace std;
#define int long long
int ans[30]={},tans=0;
signed main(){
  int N;
  int dp[30]={};
  dp[0]=1;
  for(int i=1;i<=30;i++){
    //cout << i << endl;
    if(i==1) dp[i]=dp[i-1];
    else if(i==2) dp[i]=dp[i-1]+dp[i-2];
    /*else{
      int tmp=dp[i-1]+dp[i-2]+dp[i-3];
      dp[i]=tmp%3650;
      tans+=floor(tmp/3650);
      ans[i]=ans[i-1]+tans;
    }*/
    else dp[i]=dp[i-1]+dp[i-2]+dp[i-3];
  }

  while(cin >> N && N!=0){
  cout << ceil((double)dp[N]/3650.0) << endl;
  //cout << dp[N] << endl;
}
  return 0;
}

