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

using namespace std;

int main()
{

  int step_num;
  int dp[31];

  fill(dp,dp + 31,0);

  0[dp] = 1;

  for(int i = 1; i <= 30; ++i)
    {
      for(int j = 1; j <= 3; ++j)
        {

          if( i - j >= 0)   dp[i] = dp[i] + dp[i - j];

        }
    }

  while(cin >> step_num && step_num != 0) { cout << dp[step_num]/10/365 + 1<< endl; }

  return 0;

}