#include <iostream>
#include <vector>

using namespace std;

typedef long long ll;

ll solve(int n) {
    vector<ll> step(n);
    step[0] = 1;
    if( n > 1 ) step[1] = 2;
    if( n > 2 )  step[2] = 4;
    for(int i=3; i < n; ++i){
        step[i] = step[i-3] + step[i-2] + step[i-1];
    }
    return step[n-1];
}

ll getdays(ll ptns){
    if(ptns % 10 == 0) return ptns / 10;
    else return ptns / 10 + 1;
}

ll getyears(ll days){
    if(days % 365 == 0) return days / 365;
    else return days / 365 + 1;
}

int main(){
    int n;
    while(true) {
        cin >> n;
        if(n == 0) break;
        cout << getyears(getdays(solve(n))) << endl;
    }
}