(defparameter n (read))
(defparameter s (coerce (read-line) 'list))

(defun f (lst acc# acc)
  (cond ((or (endp lst)
             (endp (cdr lst)))
         acc)
        ((and (char= #\. (car lst))
              (char= #\# (cdr lst)))
         (f (cdr lst) acc# (cons (+ acc# (count #\. (cdr lst))) acc)))
        ((char= #\# (car lst))
         (f (cdr lst) (1+ acc#) acc))
        (t (f (cdr lst) acc# acc))))

(format t "~a" (f s 0 '()))
