DP = {1 => 1, 2 => 2, 3 => 4}

def dp(n)
  if DP[n] == nil
    DP[n] = dp(n-1) + dp(n-2) + dp(n-3)
  else
    DP[n]
  end
end

loop do
  n = gets.to_i
  exit if n == 0
  puts (dp(n)/3650.0).ceil
  next
end