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

    (0..n step r).map { R->
        (R..n step g).count{ (n-it)%b==0 }
    }.sum().let { println(it) }

}

