#include <bits/stdc++.h>
using namespace std;
int main() {
  const int N = 30;
  vector<long long> DP;
  DP.push_back(1);
  for (int i = 1; i <= N; i++) {
    int size = static_cast<int>(DP.size());
    long long var = 0;
    if (i - 3 >= 0) var += DP.at(size - 3);
    if (i - 2 >= 0) var += DP.at(size - 2);
    if (i - 1 >= 0) var += DP.at(size - 1);
    DP.push_back(var);
  }

  long long n;
  cin >> n;
  while (n != 0) {
    long long var = DP.at(n);
    int year = ceil(var / 3650.0);
    cout << year << endl;
    cin >> n;
  }
}

