#include <iostream>
using namespace std;
int main(void){
   // Your code here!
   int i,n,t,k,c,b;
   while(1){
       cin >> n;
       if (n==0) break;
       int a[35]={0};
       a[0]={1};
       a[1]={1};
       a[2]={2};
       for(i=3;i<=n;i++){
           a[i]=a[i-3]+a[i-2]+a[i-1];
       }
       c=a[n]/10;
       b=a[n]%10;
       if(b != 0){
           c=c+1;
       }
       k= c / 365;
       t= c % 365;
       if(t != 0){
           k=k+1;
       }
       cout << k;
       cout << endl;
}
}
