#include <iostream>
using namespace std;

int main() {
    int n;
    long long dp[35] = {0};

    dp[0] = 1;
    dp[1] = 2;
    dp[2] = 4;

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

    while (1) {
        cin >> n;
        if (n - 1 == -1) break;

        long long ans = 0;
        ans = dp[n - 1] / 3650;
        if (dp[n - 1] % 3650) ans++;
        cout << ans << endl;
    }
    return 0;
}
