#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for (int (i)=(0);(i)<(int)(n);++(i))
using ll = long long;
using P = pair<ll, ll>;
template<class T> inline bool chmax(T& a, T b) {if (a < b){a = b;return 1;}return 0;}
template<class T> inline bool chmin(T& a, T b) {if (a > b){a = b;return 1;}return 0;}
const long long LLINF = 1LL << 60;
using namespace std;

ll dp[50];

int main()
{
    int n;
    while (cin >> n and n)
    {
        fill(dp, dp+n, 0);

        dp[0] = dp[1] = dp[2] = 1;
        for (int i=0; i<n; ++i)
        {
            dp[i+1] += dp[i];
            dp[i+2] += dp[i];
            dp[i+3] += dp[i];
        }

        dp[n-1] = dp[n-1]/10 + bool(dp[n-1]%10);
        cout << dp[n-1]/365 + bool(dp[n-1]%365) << endl;
    }
}

