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

count = 0
(0..n).each do |i|
    next if r * i > n
    (0..n).each do |j|
        next if i * r + j * g > n
        count += 1 if (n - (i * r + j * g)) % b == 0
    end
end
print count