#include <bits/stdc++.h>

using namespace std;

int main(void) {
  int n, dp[31];

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

  while (cin >> n, n) {
    cout << dp[n] / 3650 + 1 << endl;
  }

  return 0;
}
