#include <iostream>
#include <vector>
#include <algorithm>
#include <queue>
#include <cstring>
#include <cstdio>
#include <cmath>
#include <set>
#include <map>
#include <bitset>
using namespace std;
using ll = long long;
using itn = int;
const ll MOD = 1000000007;
const ll INF = MOD * MOD;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }

ll dp[100010];

int main() {

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

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

    int n, res;

    while(true) {

        cin >> n;
        if (n == 0) break;

        res = 0;

        res = dp[n] / 3650;
        if (dp[n] % 3650 > 0) res++;

        cout << res << endl;
    }

    return 0;

}
