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

ulong[32] dp;

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

    writeln(pat / 365 + 1);
  }
}

ulong shinobu(ulong n)
{
  if (dp[n] != -1){
    return (dp[n]);
  }
  if (n == 1) return (1);
  if (n == 2) return (2);
  if (n == 3) return (4);

  return (dp[n] = shinobu(n - 1) + shinobu(n - 2) + shinobu(n - 3));
}