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

(defun remove-# (lst)
  (cond ((endp lst) lst)
        ((char= #\# (car lst)) (remove-# (cdr lst)))
        (t lst)))

(defun remove-. (lst)
  (cond ((endp lst) lst)
        ((char= #\. (car lst)) (remove-. (cdr lst)))
        (t lst)))

(princ (min (count #\. (remove-. s))
            (count #\# (remove-# (reverse s)))))
