#include<iostream>
#include<vector>
#include<map>

using namespace std;

struct Memo
{

  int count;
  bool flag;

  Memo()
  {
    count = 0;
    flag = false;
  }

};

Memo memo[31][4];

int ProgressNumberOfYears(int step_num, int step_kind)
{

  int kind_count = 0;


  if(step_num == 0) return 1;
  else if(step_num < 0)  return 0;
  else if(memo[step_num][step_kind].flag)  return memo[step_num][step_kind].count;
  for(int i = 1; i < 4; ++i) kind_count = kind_count + ProgressNumberOfYears(step_num - i,i);


  memo[step_num][step_kind].count = kind_count;
  memo[step_num][step_kind].flag = true;

  return kind_count;

}

int main()
{

  int step_num;

  while(cin >> step_num && step_num != 0) cout << ProgressNumberOfYears(step_num,0)/10/365 + 1<< endl;

  return 0;

}