#include <algorithm>
#include <iostream>
using namespace std;
int n;
int main() {
  while (cin >> n && n>0) {
    int A[n];
    A[0] = 1;
    for (int i=1; i<=n; ++i) { 
      A[i] = A[i-1];
      if (i>1) A[i] += A[i-2];
      if (i>2) A[i] += A[i-3];
    }
    cout << ((A[n]+9)/10+364)/365 << endl; 
  }
}