N = gets.to_i
MOD = 10 ** 9 + 7

wk = N/3
DP = Array.new(N+1).map{Array.new(wk+1, 0)}
(3..N).each{|i| DP[i][1] = 1}

(2..wk).each{|d|
  s = 0
  (3*d..N).each{|n|
    s += DP[n-3][d-1]
    DP[n][d] = s % MOD
  }
}

puts DP[N].inject(:+) % MOD
