fun main(args: Array<String>) {
    val (r, g, b, n) = readLine()!!.split(' ').map(String::toInt)
    var cnt = 0
    for (rr in (0..n / r)) {
        for (gg in (0..n / g)) {
            val x = n - (rr * r + gg * g)
            if (x < 0) break
            if (x % b == 0) cnt++
        }
    }
    println(cnt)
}
