r,g,b,n=gets.split.map(&:to_i)
count=0
for i in 0..n
    for j in 0..n
        if (n-r*i-g*j).div(b)<=n && (n-r*i-g*j)%b==0 && (n-r*i-g*j).div(b)>=0
            count+=1
            
        end
    end
end

p count