class Yukicoder def initialize n = gets.to_i dp = Array.new(2*n+3, 0) dp[1] = 1 dp[2] = 1 1.upto(n) do |i| j = i*2 j.downto(i) do |k| if dp[k] > 0 dp[k+1] += dp[k] dp[k+2] = dp[k] end end end puts dp[n] end end Yukicoder.new