#include <algorithm>
#include <iostream>
#include <numeric>
#include <vector>

using namespace std;

typedef long long ll;
typedef std::vector<int> vi;
typedef std::vector<vi> vvi;

#define REP(i, n) for (ll i = 0; i < n; i++)
#define RREP(i, n) for (ll i = n - 1; i >= 0; i--)
#define FOR(i, n, m) for (ll i = n; i < m; i++)
#define RFOR(i, n, m) for (ll i = n - 1; i >= m; i--)

void output() { std::cout << std::endl; }
void input() {}

template <class Head, class... Tail> void input(Head &&head, Tail &&... tail) {
  std::cin >> head;

  input(std::forward<Tail>(tail)...);
}

template <class Head, class... Tail> void output(Head &&head, Tail &&... tail) {
  std::cout << head;
  if (sizeof...(tail))
    std::cout << " ";

  output(std::forward<Tail>(tail)...);
}

int main() {
  do {

    ll n;
    input(n);
    if (!n)
      break;

    vi s(n + 1, 0);
    s[0] = 1;
    FOR(i, 1, n + 1) {
      if (i > 2)
        s[i] += s[i - 3];
      if (i > 1)
        s[i] += s[i - 2];
      s[i] += s[i - 1];
    }

    output((s[n] - 1) / 3650 + 1);

  } while (true);
  return 0;
}
