import java.util.*

fun main() {
    val pw = java.io.PrintWriter(System.out)
    Problem.solve(Scanner(System.`in`), pw)
    pw.flush()
}

object Problem {
    val MOD = 1000000007L
    fun solve(sc: Scanner, pw: java.io.PrintWriter) {
        val S = sc.next().toInt()
        val dp = LongArray(2001)
        dp[3] = 1
        dp[4] = 1
        dp[5] = 1
        for (i in 6..2000) {
            var a = 1L
            for (j in 3..(i - 3)) {
                a += dp[j]
                a %= MOD
            }
            dp[i] = a
        }
        pw.println(dp[S])
    }
}
