#include <iostream>
#include <vector>

using namespace std;
typedef long long ll;
typedef vector<ll> vll;

const int N = 31;

ll calc(int n,vll& memo){
    if(memo[n] != -1) return memo[n];
    ll ret = 0;
    for(int i=1;i<=3;i++){
        ret += calc(n-i,memo);
    }
    return memo[n] = ret;
}

int main(){
    vll memo(N,-1);
    memo[1] = 1;
    memo[2] = 2;
    memo[3] = 4;
    while(true){
        int n;
        cin >> n;
        if(n == 0) break;
        cout << calc(n,memo) / 3650 + 1 << endl;
    }
    return 0;
}