fun main(args : Array<String>) {
    val (R, G, B, N) = readLine()!!.split(" ").map { it.toInt() }

    var count = 0

    (0..N).forEach { r ->
        (0..N).forEach { g ->
            val remain = N - (R * r + G * g)
            if (remain >= 0 && remain.mod(B) == 0) {
                count++
            }
        }
    }

    println(count)
}