#include <iostream>
#include <cstring>
using namespace std;

#define MIN(X,Y) ((X)<(Y)?(X):(Y))

int main(void){
  int n,dp[32];
  
  dp[0] = 1;
  dp[1] = 1;
  dp[2] = 2;
  for (int i=3; i<=30; i++){
    dp[i] = dp[i-1] + dp[i-2] + dp[i-3];
  }
  
  while (cin >> n){
    int ans;
    if (n==0) break;
    ans = ((dp[n]+9)/10+364)/365;
    cout << ans << endl;
  }
  return 0;
}
  
  

