fun main(args: Array<String>) {
    val (r, g, b, n) = readIntegerList()
    var ans = 0L
    for (i in 0..n) {
        for (j in 0..n) {
            val k = n - (i * r) - (j * g)
            if (k >= 0 && k % b == 0) {
                ans++
            }
        }
    }
    println(ans)
}


fun readInteger() = readLine()!!.toInt()
fun readLong() = readLine()!!.toLong()
fun readStringList() = readLine()!!.split(" ")
fun readIntegerList() = readStringList().map(String::toInt)
fun readLongList() = readStringList().map(String::toLong)
