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

int dp[31];

int main() {
    dp[0] = 1;
    for(int i = 0; i < 30; i++) {
        if(i + 1 <= 30)
            dp[i + 1] += dp[i];
        if(i + 2 <= 30)
            dp[i + 2] += dp[i];
        if(i + 3 <= 30)
            dp[i + 3] += dp[i];
    }

    while(true) {
        int n;
        cin >> n;
        if(n == 0)
            break;
        cout << ((dp[n] + 9) / 10 + 364) / 365 << endl;
    }
}
