r,g,b,n = gets.chomp.split.map(&:to_i)

count = 0
for i in 0..3000
    for j in 0..3000
        tmp_sum = r*i + j * g
        tmp = n-tmp_sum
        if tmp%b == 0 && tmp >= 0
            count+=1
        end
    end
end
puts count