r,g,b,n = $stdin.read.split(" ").map(&:to_i)

count = 0
(0..3000).each do |ri|
  if ri*r>n
    break
  end
  (0..3000).each do |gi|
    if ri*r + gi*g > n
      next
    end

    bi = (n - ri * r - gi * g)/b

    if ri*r + gi*g + bi*b == n
      count += 1
    end
  end
end

puts count