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

int A[128], N;
int main(){
  A[0] = 1;
  while(cin >> N && N > 0){
    for(int i=1; i<=32; i++){
      A[i] = A[i-1];
      if(i>=2) A[i] += A[i-2];
      if(i>=3) A[i] += A[i-3];
    }
    ll days = (A[N]+9) / 10;
    ll ans = (days+364) / 365;
    cout << ans << endl;
  }
  return 0;
}

