r,g,b,n=io.read("*n","*n","*n","*n")

counter=0
for i=0,3000 do
    for j=0,3000 do
        rg=r*i+g*j
        if n>=rg and (n-rg)%b==0 then
            counter=counter+1
        end
    end
end
print(counter)