stairs = []

loop do
  n = gets.to_i
  break if n.zero?

  stairs << n
end

stairs.each do |n|
  dp = Array.new(n + 1, 0)
  dp[0] = 1
  dp[1] = 1

  (2..n).each do |i|
    dp[i] += dp[i - 1] + dp[i - 2]
    dp[i] += dp[i - 3] if i > 2
  end

  day = (dp[n] / 10.0).ceil
  year = (day / 365.0).ceil
  p year
end

