// 0168_Kannondou.cpp
//
#include <bits/stdc++.h>
using namespace std;
const int MAX_N = 30;
int dp[MAX_N+1];
int solve(int n) {
  for(int i=0; i<=n; ++i) {
    if(i<=2) dp[i]=i;
    dp[i] = dp[i-1]+dp[i-2]+dp[i-3];
  }
  return dp[n];
}
int main() {
  int n;
  while(cin >> n, n){
    fill(dp, dp+MAX_N+1, 0);
    int day = (solve(n) + 10-1)/10;
    int year = (day + 365-1)/365;
    cout << year << endl;
  }
  return 0;
}

