#include <bits/stdc++.h>
using namespace std;

#define rep(i,n) for(int i=0; i<(n); ++i)
using ll = long long;
using P = pair<int, int>;
template<class T> inline bool chmin(T& a, T b) {if (a > b) { a = b; return true; } return false;}
template<class T> inline bool chmax(T& a, T b) {if (a < b) { a = b; return true; } return false;}

const int MAX_N = 10 + 3;

int main() {
  vector<ll> dp(MAX_N, 0);
  dp[0] = 1;
  dp[1] = 2;
  dp[2] = 4;
  for (int i=3; i<30; ++i) {
    dp[i] = dp[i-1] + dp[i-2] + dp[i-3];
    //    printf("[*] dp[%d] = %lld\n", i, dp[i]);
  }
  
  while (true) {
    int n;
    cin >> n;
    if (n == 0) break;
    cout << (dp[n-1] + 3650 - 1) / 3650 << endl;
  }
  return 0;
}

