def solve(n)
  dp = Array.new(n, 0)
  (0...n).each do |i|
    if i == 0
      dp[i] = 1
    elsif i == 1
      dp[i] = 2
    elsif i == 2
      dp[i] = 4
    else
      dp[i] = dp[i-1] + dp[i-2] + dp[i-3]
    end
  end

  dp[-1]
end

def to_days(n)
  q = n / 10
  r = n % 10

  r > 0 ? q + 1 : q
end

def to_years(n)
  n = to_days(n)

  q = n / 365
  r = n % 365

  r > 0 ? q + 1 : q
end

loop do
  i = gets.chomp.to_i
  if i == 0
    break
  else
    puts(to_years(solve(i)))
  end
end

