#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define repI(i, d, n) for (int i = (d); i < (n); ++i)
using namespace std;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }

using ll = long long;
using P = pair<int, int>;
using Pl = pair<ll, ll>;
using M = map<int, int>;
ll const INF = 1ll<<61;
double pi = 3.141592653589793238;
ll const MAX = 30;
ll const DAYS = 3650;

int main() {
  vector<ll> dp(MAX+1, 0);
  dp[0] = 1;

  repI(i, 1, MAX+1) {
    dp[i] += dp[i-1];
    if (i > 1) dp[i] += dp[i-2];
    if (i > 2) dp[i] += dp[i-3];
  }
  ll n;

  while(cin >> n && n) {
    cout << dp[n] / DAYS + (dp[n] % DAYS != 0) << endl;;

  }
  return 0;
}

