#include <iostream>
#include <cstdio>
using namespace std;

int main(void)
{
  int n;
  int a[31]={0};

  a[0] = 1, a[1] = 1, a[2] = 2;
  

  /* a[i] Í@iiÚÉ©©éêÌ */
  for(int i = 3 ; i <= 30 ; i++)
    {
      a[i] = a[i-1] + a[i-2] + a[i-3];
    }
  
  while(cin >> n)
    {
      if(n == 0) break;
      cout << (a[n] / 10 / 365 + 1) << endl;
      // êúPOÅÁÄANÈÌÅRUTÅéBPúÅàêNvZÈÌÅPð«·
    }
  return 0;
}