import java.util.*
import kotlin.math.acos
import kotlin.math.cos
import kotlin.math.round
import kotlin.math.sin

fun main() {
    val s = readInt()

    val ans = MutableList(2001) { 0 }

    val mod = 1000000007
    ans[0] = 1
    for (i in 1..s) {
        for (j in 0..i-3) ans[i] = (ans[i] + ans[j]) % mod
    }
    println(ans[s])
}

fun readString() = readLine()!!
fun readInt() = readLine()!!.toInt()