#include <bits/stdc++.h>
#define rep(i,n) for (int i=0; i<(n); ++i)
using namespace std;

const int MX=40,INF=1001001001,mod=1e9+7;
int dp[MX];

int main(){
    while(1){
        int n;
        cin>>n;
        if(n==0)break;
        rep(i,MX)dp[i]=0;
        dp[0]=1;
        rep(i,n){
            dp[i+1]+=dp[i];
            dp[i+2]+=dp[i];
            dp[i+3]+=dp[i];
        }
        int day;
        if(dp[n]%10==0)day=dp[n]/10;
        else day=dp[n]/10+1;
        int year;
        if(day%365==0)year=day/365;
        else year=day/365+1;
        cout<<year<<endl;
    }
}
