#include <bits/stdc++.h>
using namespace std;
#define int lint
typedef long long lint;
typedef pair<int,int> P;
const int    INF=(int)1e9;
const int    MOD=(int)1e9+7;
const double EPS=(double)1e-10;
struct Accelerate_Cin{
    Accelerate_Cin(){
        cin.tie(0); ios::sync_with_stdio(0);cout<<fixed<<setprecision(20);
    };
};



signed main(){
  int n;
  queue<int>q;
  while(cin>>n,n){
    int dp[100];
    dp[1]=1,dp[2]=2,dp[3]=4;
    for(int t=1;t<30;t++){
      dp[t+3]=dp[t+2]+dp[t+1]+dp[t];
    }
    q.push(ceil((double)dp[n]/3650));
  }

  while(!q.empty()){
    cout<<q.front()<<endl;
    q.pop();
  }
  return 0;
}

