#include <iostream>
using namespace std;

int main()
{
  while (true)
  {
    int n;
    cin >> n;
    if (!static_cast<bool>(n)) break;

    int DP[30 + 3] = {0};
    DP[0] = 1;

    for (int i = 1; i <= n; ++i)
    {
      for (int j = 0; j < 3; ++j)
      {
        DP[i + j] += DP[i - 1];
      }
    }

    int ans = (((DP[n] + 9) / 10) + 364) / 365;

    cout << ans << endl;
  }

  return 0;
}

