#include <iostream>
using namespace std;

int ans;

int rec(int n, int now) {
  static int ans;
  if(now == 0) ans = 0;
  for(int i = 1; i <= 3; i++) {
    int next = now+i;
    if(next >= n) {
      ans++;
      break;
    }
    rec(n, next);
  }
  if(now == 0) return ans;
}

int main() {
  while(1) {
    int n;
    cin >> n;
    if(n == 0) break;

    int ans;
    ans = rec(n, 0);
    cout << ( (ans+10)/10 -1 )/ 365 + 1 << endl;
  }
  return 0;
}