#include<iostream>

using namespace std;

int ProgressNumberOfYears(int step_num, int step_kind)
{

  if(step_num == 0)
    return 1;
  else if(step_num < 0)
    return 0;

  int count = 0;

  for(int i = 1; i < 4; ++i)
    {

      count = count + ProgressNumberOfYears(step_num - i,i);

    }

  return count;

}

int main()
{

  int step_num;
  int day;
  double temp;


  cin >> step_num;

  while(cin >> step_num && step_num != 0)
    {

      temp = ProgressNumberOfYears(step_num,0)/10.0/365.0;
      day = (int)ProgressNumberOfYears(step_num,0)/10.0/365.0;
      if(temp - day > 0) cout << day + 1 << endl;
      else if(temp == day)cout << day << endl;

    }

  return 0;

}