#include <bits/stdc++.h>
#define REP(i, n) for(int i = 0;i < n;i++)
#define SORT(v, n) sort(v, v+n);
#define VSORT(v) sort(v.begin(), v.end())
#define VRSORT(v) sort(v.rbegin(), v.rend())//vectorの降順ソート
#define ll long long
#define pb(a) push_back(a)
#define INF 1000000000
#define MOD 1000000007
using namespace std;
typedef pair<int, int> P;
typedef pair<ll, ll> LP;
typedef pair<int, P> PP;
typedef pair<ll, LP> LPP;

typedef vector<unsigned int>vec;
typedef vector<vec> mat;

template<class T> inline bool chmin(T& a, T b) {
    if (a > b) {
        a = b;
        return true;
    }
    return false;
}
template<class T> inline bool chmax(T& a, T b) {
    if (a < b) {
        a = b;
        return true;
    }
    return false;
}

int dy[]={0, 0, 1, -1, 0};
int dx[]={1, -1, 0, 0, 0};

ll dp[31];

int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);

    dp[1]=1;
    dp[2]=2;
    dp[3]=4;
    for(int i=4;i<31;i++) dp[i] = dp[i-1] + dp[i-2] + dp[i-3];
    while(true){
        int d;cin>>d;
        if(d==0) return 0;
        ll ans = dp[d]/3650;
        if(dp[d]%3650>0) ans++;
        cout<<ans<<endl;
    }
}

