#include "bits/stdc++.h"

using namespace std;

typedef vector<int> vi;
typedef pair<int,int> pii;
typedef long long ll;

#define dump(x)  cerr << #x << " = " << (x) << endl
#define rep(i,n) for(ll i=0;i<(ll)(n);i++)
#define all(a)  (a).begin(),(a).end()
#define pb push_back

int main(){
    int dp[50];
    rep(i,50)dp[i]=0;
    dp[0]=1;
    rep(i,40){
        dp[i+1]+=dp[i];
        dp[i+2]+=dp[i];
        dp[i+3]+=dp[i];
    }
    
    
    int n;
    while(cin>>n){
        if(n==0)break;
        int num = (int)((dp[n]-1)/3650)+1;
        cout<<num<<endl;
    }

}
#include <iostream>
#include <algorithm>
using namespace std;
int main(){
      int tmp;
      int dp[100];
      cin>> tmp;
      do{
            fill(dp,dp+100,0);
            dp[0] = 1;
            for (int i = 0; i<tmp;i++)
            {
                  for(int j = 1;j < 4;j++)
                        dp[i+j] += dp[i];
            }
            cout << dp[tmp]/3650 + 1<<endl;
            cin >> tmp;
      }while(tmp);

}