(defun main (&rest argv) (declare (ignorable argv)) (let* ((n (read)) (a (make-array 36 :element-type 'integer :initial-element 0)) (res 0)) (loop for i from 1 to n do (incf (aref a (read)))) (loop for i from 1 to 35 when (zerop (aref a (1- i))) do (incf res (* i (aref a i)))) (format t "~d~%" res))) (main)