#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<(int)(n);i++)
using namespace std;

using ll = long long;

int main(void){
  vector<int> stairs;
  int input;
  do{
    cin >> input;
    if(input!=0) stairs.push_back(input);
  }while(input!=0);

  rep(i,stairs.size()){
    int max_step = stairs[i];
    vector<int> dp(max_step+1,-10);
    if(max_step<=4){
      cout << "1" << endl;
      continue;
    }
    
    dp.at(max_step) = 1;
    dp[max_step-1] = 1;
    dp[max_step-2] = 2;
    dp[max_step-3] = 4;
    for(int j=max_step-2;j>=0;j--){
      if(j+3<=max_step) dp.at(j) = dp.at(j+1)+dp.at(j+2)+dp.at(j+3);
    }
    ll day = dp[0]/10;
    ll ans;
    if(day%365==0) ans = day/365;
    else ans = day/365+1;
    cout << ans << endl;
  }
  
  return 0;
}

