#include <bits/stdc++.h>
using namespace std;
using ll = long long;
constexpr ll MOD=1000000007;
#define REP(i,n) for(ll i=0; i<(n); i++)
#define REP2(i,x,n) for(ll i=x; i<(n); i++)
const long long INF = numeric_limits<long long>::max();
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 main()
{
    
    while(1){
        ll N;
        cin >> N;
        if ( N == 0 )   break;

        vector<ll> dp(N+1, 0);
        dp[0] = 1;

        for ( ll i = 0; i < N; ++ i ){
            for ( ll j = 1; j <= 3; ++ j ){
                ll n = i + j;
                if ( n > N )    break;
                dp[n] += dp[i];
            }
        }

        auto ans =static_cast<ll>( ceil((float)dp[N] / ( 10.f * 365)));

        cout << ans << endl;
    }
    return 0;
}
