require 'set'; require 'prime'; require 'pp'
INF=Float::INFINITY; MOD=10**9+7
s = gets.chomp.to_i

dp = [0,0,0,1,1,1,2,3,4,6,9]
if s <= 10
  puts dp[s]
else
  11.upto(s) do |i|
    dp.push (dp[i-1] + dp[i-3]) % MOD
  end
  puts dp.last
end