import std.stdio, std.conv, std.string, std.range, std.array, std.algorithm;
import std.bigint;

void main()
{
  while (true){
    ulong n = readln().chomp().to!ulong;
    if (n == 0) break;
    ulong pat = shinobu(n);
    pat /= 10;
    if (pat % 10 != 0){
      pat++;
    }

    writeln(pat / 365 + 1);
  }
}

ulong shinobu(ulong n)
{
  if (n == 1) return (1);
  if (n == 2) return (2);
  if (n == 3) return (4);

  return (shinobu(n - 1) + shinobu(n - 2) + shinobu(n - 3));
}