#include <iostream>

using namespace std;

int a[31];

int main (void){
a[0]=1;
a[1]=1;
a[2]=2;
for(int i=3; i<=30;i++)
     a[i]=a[i-1]+a[i-2]+a[i-3];
int n;
while(cin >> n,n|0){
    int ans=a[n]/3650;
    if(a[n]%3650)
         ans++;
    cout << ans << endl;
}
return 0;
}