#include <iostream>
using namespace std;
int count(int);
int main(void){
    int n,x;
    while(1){
        cin >> n;
        if(n==0) break;
 
        x=count(n)/10;
        cout << x/365+1 << endl;
    }
}
 
int count(int n){
    if(n==1) return 1;
    else if(n==2) return 2;
    else if(n==3) return 4;
    else return count(n-1)+count(n-2)+count(n-3);
}
