Moves = [1,2,3]
MaxStep = 30

def solve
  dp = Array.new(MaxStep + 1, 0)
  dp[0] = 1
  for step in 1...MaxStep
    Moves.each do |m|
      break if step - m < 0
      dp[step] += dp[step - m]
    end
  end
  dp
end

result = solve

while (n = $stdin.gets.to_i) != 0
  printf "%d\n", (result[n].to_f / 3650.to_f).ceil
end