#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;

long long dp[MAX_N+3];

int main() {
  dp[0] = 1;

  for (int i{}; i < MAX_N; ++i) {
    dp[i+1] += dp[i];
    dp[i+2] += dp[i];
    dp[i+3] += dp[i];
  }

  while (true) {
    int N; cin >> N;
    if (!N) break;
    cout << DIVCEIL(dp[N], 3650) << endl;
  }

  return 0;
}

