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

    
}
