# util functions

# debug
$debugFlag = ( ARGV[0] != nil )
p "==== DEBUG MODE ====" if $debugFlag

def pd(str)
  p str if $debugFlag
end

# input
inputs = []
lc = 0
while l = $stdin.gets do
  if false
    inputs << l.chomp.split(" ").map(&:to_s)
  else
    inputs << l.chomp.split(" ").map(&:to_i)
  end
  lc += 1
end

# input check
if $debugFlag
  p "--- INPUT (begin) ---"
  inputs.each do |l_i|
    p l_i
  end
  p "--- INPUT (end) ---"
  print "\n"
end

r = inputs[0][0]
g = inputs[0][1]
b = inputs[0][2]
nn = inputs[0][3]

# body
if $debugFlag
  p r
  p g
  p b
  p nn
end

arr = [r, g, b].sort
x = arr[2]
y = arr[1]
z = arr[0]

cnt = 0
for i in 0..nn/x do
  for j in 0..nn/y do
    cnt += 1 if (nn - i*x - j*y)%z == 0 and (nn - i*x - j*y) >= 0
    # if (nn - i*x - j*y)%z == 0
    #   p "(#{i}, #{j}, #{(nn-i*x-j*y)/z})"
    # end
  end
end

puts cnt
