#include<iostream>
int x[100];

using namespace std;
int count(int step){
  int ret = 0;
  if(step < 0)return 0;
  if(step == 0)return 1;
  if(x[step] > 0)return x[step];
  for(int i = 1;i <= 3;i++){
    ret += count(step - i);
  }
  return x[step] = ret;
}

int main(){
  int n;
  while(cin >> n && n > 0){
    cout << ((count(n)+9) / 10 + 364)/365 << endl;
  }
}