(defun main (&rest argv) (declare (ignorable argv)) (let* ((aw (read)) (ab (read)) (bw (read)) (bb (read)) (c (read)) (d (read)) (res (- (+ aw (min (+ bw (max 0 (- c ab))) d)) (max 0 (- c ab))))) (declare (ignore bb)) (format t "~d~%" res))) (main)