s = gets.to_i

h = {
  0 => 0,
  1 => 0,
  2 => 0,
  3 => 1,
}

r = 0

if s <= 3
  puts h[s]
else
  3.upto(s) do |x|
    r = 0
    3.upto(x-3) do |i|
      t = x - i
      r += h[t]
    end
    r += 1
    h[x] = r
  end

  puts h[s] % 1000000007
end
