#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define all(v) v.begin(), v.end()
typedef pair<int, int> P;
template <class T>
inline bool chmin(T& a, T b) {
  if (a > b) {
    a = b;
    return true;
  }
  return false;
}
template <class T>
inline bool chmax(T& a, T b) {
  if (a < b) {
    a = b;
    return true;
  }
  return false;
}

const int INF = 1001001001;
const vector<int> di = {-1, 0, 1, 0};
const vector<int> dj = {0, -1, 0, 1};

vector<int> vec;
vector<int> ans_vec;

int main() {
  while (1) {
    int n;
    cin >> n;
    if (n == 0) break;
    vec.push_back(n);
  }

  for (auto&& n : vec) {
    vector<int> dp(n + 1, 0);
    dp[0] = 1;
    dp[1] = 1;

    for (int i = 2; i <= n; i++) {
      dp[i] += dp[i - 1] + dp[i - 2];
      if (i > 2) {
        dp[i] += dp[i - 3];
      }
    }

    int ans = ceil(ceil((double)dp[n] / 10.0) / 365.0);
    ans_vec.push_back(ans);
  }

  for (auto&& i : ans_vec) {
    printf("%d\n", i);
  }
}

