#include <iostream>
#include <cstring>
#include <cmath>
using namespace std;


int memo[32];
int N;


int rec(int n)
{
  if(memo[n] != -1) return memo[n];

  if(n == N) return 1;
  if(n >= N) return 0;

  int ret = 0;
  for(int i = 1; i <= 3; i++) {
    ret += rec(n+i);
  }

  return memo[n] = ret;
}

int main()
{
  for(; cin >> N && N; ) {
    memset(memo, -1, sizeof memo);
    cout << ceil(rec(0) / 3650.0) << endl;
  }
}