#include <iostream>
using namespace std;
int main(void){
    int n,a[31],year,i;
    a[1] = 1;
    a[2] = 2;
    a[3] = 4;
    for(i = 4; i < 31; i++){
        a[i] = a[i-3] + a[i-2] + a[i-1]; 
        //cout << n[i] << endl;                   //a[i]=何通りか
    }
    while(true){
        cin >> n;                                   //n=段数   
        if(n == 0)    break;
        else{
            year = a[n] / 3650;
            cout << year + 1 << endl; 
        }
    }
}

