#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
using namespace std;
typedef long long ll;
#define rep(i,n) for (int i=0;i < (int)(n);i++)

int main(){
  int ns[31];
  int id=0;
  vector<ll> dp(31);
  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(1){
    int x;
    cin >> x;
    if (x==0) break;
    else {
      ns[id]=x;
      id++;
    }
  }
  int id2=0;
  rep(i,id){
    int tmp;
    tmp=ns[id2];
    id2++;
    //cout << dp[tmp] << endl;
    ll ans;
    ans=(dp[tmp]+10-1)/10;
    cout << (ans+365-1)/365 << endl;
  }
  return 0; 
}

