#include <bits/stdc++.h>
using namespace std;

using ll = long long;
using ull = unsigned long long;
using st = string;
using db = double;
using vll = vector<long long>;
using vdb = vector<db>;
using vvll = vector<vll>;
using vst = vector<st>;
using vchar = vector<char>;
using pll = pair<ll, ll>;
using vpll = vector<pll>;
using vvpll = vector<vpll>;
#define rep(i, m, n) for (int i = (int)(m); i < (int)(n); i++)
#define vrep(i, vec) for(auto& i : vec)
#define vin(vec) for(auto& i : vec) cin >> i
#define all(v) v.begin(), v.end()
ll mod = 1000000007; 
template<class T> inline bool chmin(T& a, T b){if(a > b){a = b;return true;} return false;}
template<class T> inline bool chmax(T& a, T b){if(a < b){a = b;return true;} return false;}

int main(){
  vll dp(31, 0);
  dp.at(0) = 1;
  rep(i, 0, 30){
    rep(j, i + 1, min(30, i + 3) + 1){
      dp.at(j) += dp.at(i);
    }
  }
  
  while(true){
    ll n;
    cin >> n;
    if(n == 0) break;
    cout << (dp.at(n) + 3649) / 3650 << endl; 
  }
}
