//40
#include<iostream>

using namespace std;

int main(){
  int w[33]={1};
  for(int i=0;i<=29;i++){
    w[i+1]+=w[i];
    w[i+2]+=w[i];
    w[i+3]+=w[i];
  }
  for(int n;cin>>n,n;){
    cout<<(w[n]+3649)/3650<<endl;
  }
  return 0;
}