#include <iostream>
using namespace std;

int main() {
  int n;
  long long dp[50] = {0};
  for (int i = 0; i <= 30; i++) {
    if (i == 0) {
      dp[i] = 1;
    }
    else if (i == 1) {
      dp[i] = dp[i-1];
    }
    else if (i == 2) {
      dp[i] = dp[i-2] + dp[i-1];
    }
    else {
      dp[i] = dp[i-3] + dp[i-2] + dp[i-1];
    }
  }
  while (cin >> n && n > 0) {
    cout << (dp[n] + 3650 - 1)/3650 << endl;
  }
  return 0;
}
