fun main(args: Array<String>) {
    val inputs = readInputLine().split(" ").map { Integer.parseInt(it) }
    
    val R = inputs[0]
    val G = inputs[1]
    val B = inputs[2]
    val N = inputs[3]
    
    var ans = 0
    
    // 何も考えずにループを回す
    for (i in 0..(N / R)) {
        for (j in 0..((N - R * i) / G)) {
            if ((N - R * i - j * G) % B == 0) {
                ans++
            }
        }
    }
    
    println(ans)
}
 
fun readInputLine(): String {
    return readLine()!!
}
