fun main(args: Array<String>) {
    val (R,G,B,N)=readLine()!!.split(" ").map { it.toInt() }
    var count=0
    var sum=0
    for(r in 0 .. 3000){
        sum=R*r
        if(sum>N) break
        for(g in 0 .. 3000){
            sum=R*r+G*g
            if(sum>N) break
            if((N-sum)%B==0)count+=1
        }
    }
    print(count)
}