#include <bits/stdc++.h>
using namespace std;

int main() {
    while (true) {
        int n;
        cin >> n;
        if (n == 0) break;
        vector<long long> dp(n + 1, 0);
        dp[0] = 1;
        for (int i = 1; i <= n; i++) {
            dp[i] += dp[i - 1];
            if (i > 1) dp[i] += dp[i - 2];
            if (i > 2) dp[i] += dp[i - 3];
        }
        int ans = ceil(dp[n] / 3650.0);

        cout << ans << endl;
    }

    return 0;
}
