#include<iostream>
#include<vector>
#include<cmath>
#define rep(i,n) for(int i=0;i<n;i++)
using namespace std;
typedef long long ll;

int main()
{
    while (true)
    {
        int n;
        cin>>n;
        if(n==0)break;

        vector<ll> dp(n+1);
        dp[0]=dp[1]=1;
        dp[2]=2;
        for (int i = 3; i < dp.size(); i++)
        {
            dp[i]=dp[i-1]+dp[i-2]+dp[i-3];
        }
        int d,a,b;
        d=ceil(dp[n]/10);
        a=d/365;
        b=d%365;
        if(a>0)
        {
            if(b>0) a++;
            cout<<a<<endl;
        }
        else cout<<1<<endl;
    }
    

    return 0;
}
