#include <iostream>

using namespace std;

int main(){
  int n;

  while(1){
    int star[31] = { 0 };
    cin >> n;
    if(n == 0) break;
    star[0] = 1;

    for(int i = 1; i <= n; i++){
      if(i > 0) star[i] += star[i-1];
      if(i > 1) star[i] += star[i-2];
      if(i > 2) star[i] += star[i-3];
    }
    
    cout << star[n]/3650 + 1 << endl;
  }

  return 0;
}