(defun main (&rest argv) (declare (ignorable argv)) (let* ((*read-default-float-format* 'double-float) (n (read)) (a 0) (b 0) (res 0)) (dotimes (_ n) (let* ((x (read))) (cond ((= x a) (setf res (1+ res) b 1)) ((not (zerop b)) (setf b 0)) (t (setf res (1+ res) b 1))) (setq a x))) (format t "~d~%" res))) (main)