#include <bits/stdc++.h>
using namespace std;

#define MIN(x, y) ((x) < (y) ? (x) : (y))
#define MAX(x, y) ((x) > (y) ? (x) : (y))
#define ABS(x, y) ((x) > (y) ? ((x) - (y)) : ((y) - (x)))

#define MOD(x, y) ((x) % (y))
#define DIVCEIL(x, y) (((x) + ((y) - 1)) / (y))
#define DIVFLOOR(x, y) (((x) + ((y) / 2)) / (y))
#define DIVROUND(x, y) ((x) - MOD(x, y) >= MOD(x, y) ? DIVCEIL(x, y) : DIVFLOOR(x, y))

constexpr int MAX_N = 30;
constexpr int MAX_K = 3;

int dp[MAX_N+1];

int main() {
  int N;
  while (true) {
    cin >> N;
    if (N == 0)
      break;
    fill_n(dp, MAX_N+1, 0);
    dp[0] = 1;
    dp[1] = 1;
    dp[2] = 2;

    for (int i{MAX_K}; i <= N; ++i) {
      for (int j{1}; j <= MAX_K; ++j) {
        dp[i] += dp[i-j];
      }
    }

    cout << DIVCEIL(dp[N], 3650) << endl;
  }

  return 0;
}

