N = 30

steps = []
steps[0..2] = 1, 2, 4
for i in 3..N do
  steps[i] = steps[i - 1] + steps[i - 2] + steps[i - 3]
end

while((n = gets.to_i - 1) && n != -1) do
  puts (steps[n] % 3650 == 0 ? steps[n] / 3650 : steps[n] / 3650 + 1)
end