fun main(args:Array<String>) {
    val (r,g,b,n) = readLine()!!.split(" ").map { it.toInt() }

    var ans = 0
    for(i in (0..n)) {
        val remain = n - (r*i)
        if(remain < 0) {
            break
        }
        for(j in (0..n)) {
            val tmp = remain - (j*g)
            if(tmp < 0) {
                break
            }
            if(tmp % b == 0) {
                ans++
            }
        }
    }
    println(ans)
}
