import java.util.*

fun main(args: Array<String>) {
    val sc = Scanner(System.`in`)
    val r = sc.nextInt()
    val g = sc.nextInt()
    val b = sc.nextInt()
    val n = sc.nextInt()

    val ret = (0..n).map { i ->
        (0..n).map { j ->
            if (n - r * i - g * j >= 0) {
                if ((n - r * i - g * j) % b == 0) 1 else 0
            } else 0
        }.sum()
    }.sum()

    println(ret)
}