#include <iostream>
#include <algorithm>
#include <cmath>
using namespace std;

static const int N_MAX = 50;

int main() {
    static int dp[N_MAX];
    fill(dp, dp + N_MAX, 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];
    }

    for(int N; cin >> N, N; ) {
        cout << ceil(dp[N] / (10.0 * 365)) << endl;
    }
}