#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const int INF = 1e9;
const int MOD = 1e9 + 7;

int main()
{
  int n;
  while (cin >> n, n)
  {
    ll dp[31] = {};
    dp[1] = dp[2] = dp[3] = 1;
    for (int i = 0; i < n; ++i)
    {
      dp[i + 1] += dp[i];
      dp[i + 2] += dp[i];
      dp[i + 3] += dp[i];
    }
    cout << (dp[n] - 1) / 3650 + 1 << endl;
  }

  return 0;
}

