#include <bits/stdc++.h>

using namespace std;
using ll = long long;
using pii = pair<int, int>;

int main() {
  cin.tie(0);
  ios_base::sync_with_stdio(false);
  cout << fixed << setprecision(10);
  
  int dp[31] = {};
  dp[0] = dp[1] = 1;
  dp[2] = 2;
  for (int i = 3; i <= 30; i++) {
    for (int j = i - 3; j < i; j++) {
      dp[i] += dp[j];
    }
  }
  int n;
  while (cin >> n, n) {
    cout << dp[n] / (10 * 365) + 1 << endl;
  }

  return 0;
}
