#include <iostream>
using namespace std;
int main(void){
    int i,n,a[31],year;
    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];  //n[i]は1~30までの通り
    }
    while(true){
        cin >> n;
        if(n == 0){
            break;
        }
        else{
            year = a[n] / 3650;
            cout << year + 1 << endl;
        }
    }
}
