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

using namespace std;

struct Memo
{

  int count;

  Memo()
  {
    count = 0;
  }

};

Memo memo[31];

int ProgressNumberOfYears(int step_num)
{

  int kind_count = 0;

  if(step_num == 0) return 1;
  else if(memo[step_num].count) return memo[step_num].count;

  if(step_num - 3 >= 0)  kind_count = kind_count + ProgressNumberOfYears(step_num - 3);
  if(step_num - 2 >= 0)  kind_count = kind_count + ProgressNumberOfYears(step_num - 2);
  if(step_num - 1 >= 0)  kind_count = kind_count + ProgressNumberOfYears(step_num - 1);

  memo[step_num].count = kind_count;

  return kind_count;

}

int main()
{

  int step_num;

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

  return 0;

}