#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const ll MOD = 1e9 + 7/*998244353*/;
const ll INF = 1LL << 60;
ll mod_pow(ll, ll, ll); ll mod_fact(ll, ll); ll mod_inv(ll, ll); ll gcd(ll, ll); ll lcm(ll, ll);
//
int main(){
    while(true){
        int n;
        cin >> n;
        if(!n) break;
        vector<ll> way(31);
        way[0] = 1;
        way[1] = 1;
        way[2] = 2;
        for(int i = 3; i <= n; i++){
            way[i] = way[i - 1] + way[i - 2] + way[i - 3];
        }
        int total = way[n];
        cout << ((total + 9) / 10 + 364) / 365 << endl;
    }
}
