let s = Int(readLine()!)!
let devider = 1000_000_000 + 7
var dpTable: [Int] = .init(repeating: 0, count: s+1)

dpTable[0] = 1
dpTable[1] = 0
dpTable[2] = 0

if s >= 3 {
    for i in 3...s {
        dpTable[i] = dpTable[i-3]+dpTable[i-1]
        dpTable[i] %= devider
    }
}

print(dpTable[s])

