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

(defun count-#.->## (lst prev acc)
  (cond ((endp lst) acc)
        ((and (char= #\# prev)
              (char= #\. (car lst)))
         (count-#.->## (cdr lst) #\# (1+ acc)))
        (t (count-#.->## (cdr lst) (car lst) acc))))
(defun count-.#->.. (lst prev acc)
  (cond ((endp lst) acc)
        ((and (char= #\. prev)
              (char= #\# (car lst)))
         (count-.#->.. (cdr lst) #\. (1+ acc)))
        (t (count-.#->.. (cdr lst) (car lst) acc))))

(princ (min (count-#.->## (cdr s) (car s) 0)
            (count-.#->.. (cdr (reverse s)) (car (last s)) 0)))
