main=do
    line<-getLine
    let ipn=[read x::Int|x<-words line]
    let vr=ipn!!0
    let vg=ipn!!1
    let vb=ipn!!2
    let n=ipn!!3
    print $ length [nr|nr<-[0..(div n vr)],ng<-[0..(div n vg)],n-nr*vr-ng*vg>=0,mod (n-nr*vr-ng*vg) vb ==0]
    

