inputs = STDIN.gets.chomp.split(' ').map(&:to_i)

R = inputs[0]
G = inputs[1]
B = inputs[2]
N = inputs[3]

count = 0

n_r = N / R
n_g = N / G
n_b = N / B

(0..n_r).each do |r|
  rr = R * r

  if rr == N
    count += 1
    next
  end

  (0..n_g).each do |g|
    gg = G * g

    next if (rr+gg) > N

    if (rr + gg) == N
      count += 1
      next
    end

    rg = rr + gg

    count += 1 if (N - rg) % B == 0
  end
end

puts count