#include <iostream>
using namespace std;

int memo[31];

int culc_cmb( int n ){
    if( memo[n] ){
        return memo[n];
    }else{
        /*if( n == 3 ) return 4;
        else if( n == 2 ) return 2;
        else if( n == 1 ) return 1;*/
        return memo[n] = culc_cmb(n-3)+culc_cmb(n-2)+culc_cmb(n-1);
    }
}

int main(){
    memo[3] = 4;
    memo[2] = 2;
    memo[1] = 1;
    int n;
    while( cin >> n, n ){
        int ans;
        if( culc_cmb(n) % (365 * 10) ) ans =  culc_cmb(n) / (365 * 10) + 1;
        else ans =  culc_cmb(n) / (365 * 10);
        cout << ans << endl;
    }
}