#include <iostream>
using namespace std;

int main() {
    int dp[40];
    for (int i = 0; i < 40; i++) dp[i] = 0;
    dp[0] = 1;

    for (int i = 0; i < 30; i++) {
        dp[i + 1] += dp[i];
        dp[i + 2] += dp[i];
        dp[i + 3] += dp[i];
    }
    
    int n;
    while (cin >> n) {
        if (n == 0) break;
        int cnt = dp[n];
        cout << (cnt + 10 * 365 - 1) / (10 * 365) << endl;
    }
    return 0;
}
