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|
  (0..n_g).each do |g|
    (0..n_b).each do |b|
      rr = R * r
      gg = G * g
      bb = B * b
      count += 1 if (rr + gg + bb) == N
    end
  end
end

puts count