let s = Int(readLine()!)!
let mod = 1000000007

var dp = Array(repeating: 0, count: s+1)
if s >= 3 {
    dp[0] = 1
    for i in 3..<s+1 {
        dp[i] = dp[i-1] + dp[i-3]
        dp[i] %= mod
    }
}
print(dp[s])
