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

i = 0
ans = 0
while r * i <= n
    x = n - r * i
    j = 0
    while g * j <= x
        ans += 1 if (x - g * j) % b == 0
        j += 1
    end
    i += 1
end

puts ans