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

int main(){
  
  vector<ll> dp(31);
  dp[0] = 1;
  rep(i,31){
    if(!i) continue;
    dp[i] = dp[i-1];
    if(i>1) dp[i] += dp[i-2];
  	if(i>2) dp[i] += dp[i-3];
  }

  int year = 3650;
  rep(i,31) dp[i] = (dp[i]+year-1)/year; 
  //rep(i,31) cout << i << ":" << dp[i] << endl;
  
  int n; queue<int> q;
  while(cin >> n){
    if(!n) break;
    q.push(n);
  }
  while(!q.empty()){
    int a = q.front();
    cout << dp[a] << endl;
    q.pop();
  }
  return 0;
}

