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

int solve(int n) {
    vector<int> dp = {1, 1, 2};
    for(int i = 3; i <= n; i++) {
        dp.push_back(dp[i - 3] + dp[i - 2] + dp[i - 1]);
    }
    int day = (dp[n] + 9) / 10;
    return (day + 364) / 365;
}

int main() {
    vector<int> n;
    int tmp = 100000;
    while(true) {
        cin >> tmp;
        if(tmp == 0) break;
        n.push_back(tmp);
    }
    REP(i, n.size()) cout << solve(n[i]) << endl;
}

