#include<bits/stdc++.h>
using namespace std;
#define all(a) (a).begin(),(a).end()
#define rall(a) (a).rbegin(),(a).rend()
#define rep(i,n) for(int i=0; i<(n); ++i)
#define per(i,n) for(int i=n-1;i>=0;++i)
#define rep1(i,n) for(int i=1; i<=n; ++i)
#define per1(i,n) for(int i=n; i>=1; --i)
#define debug cout << "line : " << __LINE__ << " debug" << endl
#define Dcout(N) cout << setprecision(20) << N << endl
#define UNIQUE(v) v.erase( unique(v.begin(), v.end()), v.end() ) //被り削除
#define pb push_back
#define mp make_pair
#define F first
#define S second
typedef long long ll;
typedef pair<int,int> P;

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; }
//const long long INF = 1LL << 60;
//const long long mod = 1e9+7;

//------------------------------------------------------------------------

ll dp[35];
ll a[35];

int main(){
  cin.tie(0);
  ios::sync_with_stdio(false);

  int i = 0;
  while(1){
      int n; cin >> n;
      a[i] = n;
      if(n==0) break;
      i++;
  }
  int N = i;

  rep(i,N){
      rep(k,35) dp[k] = 0;
      dp[0] = 1;
      rep(j,a[i]){
          dp[j+1] += dp[j];
          dp[j+2] += dp[j];
          dp[j+3] += dp[j];
      }
      ll tmp = (dp[a[i]]/10);
      if(tmp%365==0 && tmp!=0) cout << tmp/365 << endl;
      else cout << tmp/365 + 1 << endl;
  }


  return 0;
}

