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

int main()
{
    int n;
    while (cin >> n)
    {
        if (n == 0)
            break;
        vector<int> dp(n + 1);
        dp[0] = 1;
        for (int now = 0; now < n; now++)
        {
            for (int next = now + 1; next <= min(now + 3, n); next++)
            {
                dp[next] += dp[now];
            }
        }
        int ans = dp[n] / 3650 + 1;
        cout << ans << endl;
    }
    return 0;
}
