R, G, B, N = gets.split(" ").map(&:to_i)
# p R, G, B, N
MAX = 3000
# cnt = 0
# (N/R + 1).times do |r|
#   rest = N - r * R
#   p "rest = #{rest}"
#   (rest / G + 1).times do |g|
#     rest2 = rest - g * G
#     if rest % B == 0
#       p [r, g, rest / B]
#       cnt += 1
#     end
#   end
# end

cnt = 0
(0..MAX).each do |r|
  break if R*r > N
  (0..MAX).each do |g|
    break if R*r + G*g > N
    rest = N - (R*r+G*g)
    if rest % B == 0
      cnt += 1
      # p(r: r, g: g, b: (rest/B), rest: rest, R: R*r, G: G*g, N: N, RG: R*r+G*g, RGN: N - R*r+G*g)
    end
  end
end

puts cnt
