def doit(s)
  return 0 if s < 3
  lc = Array.new(s - 3 + 1, 0)
  ln = Array.new(s - 3 + 1, 0)
  lc[0] = 1
  
  d = 10 ** 9 + 7
  
  a = 1
  b = s - 3 * a
  sum = 0
  while b >= 0 do
    stmp = 0
    (0..b).each do |i|
      stmp = (stmp + lc[i]) % d
      ln[i] = stmp
    end
    sum = (sum + ln[b]) % d
    a += 1
    b = s - 3 * a
    lc, ln = ln, lc
  end
  
  sum
end

s = gets.to_i
puts doit(s)
