fun main(args: Array<String>) {

    val (R, G, B, N) = readLine()!!.split(" ").map { Integer.parseInt(it) }
    val RMax = N / R + 1
    val GMax = N / G + 1
    val BMax = N / B + 1
    var result = 0

    for (r in 0 until RMax) {
        if ((r * R) > N) {
            break
        }
        for (g in 0 until GMax) {
            if ((r * R + g * G) > N) {
                break
            }
            val rest = N - (r * R + g * G)
            if (rest % B == 0) {
                if (((rest / B) <= BMax) && ((rest / B) >= 0)) {
                    result++
                }
            }

        }
    }
    print(result)

}