fun main(args: Array<String>) {
    val (r, g, b, n) = readLine()?.split(" ")?.map(String::toInt) ?: return
    val rr = n / r
    var total = 0L
    0.until(rr + 1).forEach { i ->
        val remain = n - (r * i)
        val gg = remain / g
        0.until(gg + 1).forEach {
            val remain2 = remain - (g * it)
            if (remain2 % b == 0) {
                total++
            }
        }
    }
    println(total.toString())
}
