#include<iostream>
#include<map>
#include<vector>
#include<algorithm>
#include<cmath>
#include<climits>
#include<ctime>
#include<cstring>
#include<numeric>

#define ALL(v) (v).begin(),(v).end()
#define REP(i,p,n) for(int i=p;i<(int)(n);++i)
#define rep(i,n) REP(i,0,n)
#define dump(a) (cerr << #a << "=" << (a) << endl)
#define DUMP(list) cout << "{ "; for(auto nth : list){ cout << nth << " "; } cout << "}" << endl;

using namespace std;


int main(){
  int n;
  int a[30];

  while(cin >> n && n > 0){
    a[0] = 1;
    a[1] = 2;
    a[2] = 4;
    REP(i, 3, n){
      a[i] = a[i-1] + a[i-2] + a[i-3];
    }

    cout << a[n-1]/3650 + 1 << endl;
  }

}
