r,g,b,n = gets.split.map(&:to_i)
box = [r,g,b]
ch = 0
i = 0
box.sort!
box.reverse!
ans = 0
while box[0]*ch <= n
  inst = n - box[0]*ch
  while box[1]*i <= inst
    if (inst - box[1]*i)%box[2] == 0
      ans += ((inst - box[1]*i) / (box[1].lcm(box[2]))) + 1
      i = 0
      break
    end
    i += 1
  end
  ch += 1
end
puts ans
