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

int dp[30];

void solve(int n) {
    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 day = (dp[n]+9)/10;
    int ans = (day+364)/365;
    cout << ans << endl;
}

int main() {
    while (true) {
        memset(dp, 0, sizeof(dp));
        int n; cin >> n;
        if (n) solve(n);
        else break;
    }

    return 0;
}
