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

for i in 0 .. n
  for j in 0 .. n
    if i * r + j * g > n
      break
    elsif (n - i * r - j * g) % b == 0
      ans += 1
    end
  end
  if i * r > n
    break
  end
end

puts ans
