s = gets.to_i
mod = 10**9 + 7
ans = 0

def combination(n, r)
  r = [r, n - r].min
  return 1 if r == 0

  (n - r + 1).upto(n).inject(:*) / 1.upto(r).inject(:*)
end

def repeated_combination(n, r)
  combination(n + r - 1, r)
end

1.upto(s / 3) { |i| ans += repeated_combination(i, s - i * 3) % mod }

puts ans % mod
