#include <bits/stdc++.h>
#include <iostream>
#include<math.h>
using namespace std;
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()
{
    vector<int64_t>dp(31, 0);
    dp[0] = 1;
    for (int64_t i=1; i<=30; i++) {
        int64_t pattern = 0;
        pattern += dp[i-1];
        if (i > 1) pattern += dp[i-2];
        if (i > 2) pattern += dp[i-3];
        dp[i] = pattern;
    }

    int N;
    while (cin >> N) {
        if (N == 0) break;
        int64_t count = dp[N] / 3650;
        if (dp[N] % 3650 > 0) {
            count += 1;
        }
        cout << count << endl;
    }
    return 0;
}
