(defun main (&rest argv) (declare (ignorable argv)) (let* ((n (read)) (k (1- (read))) (s (read-line)) (c (aref s k)) (a 0)) (declare (ignore n)) (loop while (>= a 0) do (incf k (if (eql c #\() 1 -1)) (incf a (if (eql c (aref s k)) 1 -1))) (format t "~d~%" (+ k 1)))) (main)