#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
using namespace std;

int main() {
  int n;
  while (cin >> n) {
    if (n == 0) {
      break;
    }
    vector<int> dp(n + 3);
    dp.at(n) = 1;
    for (int i = n - 1; i >= 0; i--) {
      dp.at(i) = dp.at(i + 1) + dp.at(i + 2) + dp.at(i + 3);
    }
    int total = dp.at(0);
    int day = 0;
    while (total > 0) {
      total -= 10;
      day++;
    }
    int year = (day + 365 - 1) / 365;
    cout << year << endl;
  }

  return 0;
}
