#include <bits/stdc++.h>
using namespace std;
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
typedef long long ll;
// Welcome to my source code!

template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }

const int MAX_N = 31;

int main() {
    IOS
    ll dp[MAX_N] = {};
    dp[0] = 1;
    for (int i = 1; i < MAX_N; i++) {
        dp[i] += dp[i-1];
        if (i > 1) dp[i] += dp[i-2];
        if (i > 2) dp[i] += dp[i-3];
    }
    int n;
    while (cin >> n, n) {
        ll t = ceil(dp[n] / 3650.0);
        cout << t << endl;
    }
}
