import Data.List
main = do
  _ <- getLine
  s <- getLine
  let gs = group s
  let w = sum $ map length (filter (\x -> head x == '.') (f gs))
  let b = sum $ map length (filter (\x -> head x == '#') (f gs))
  print $ min w b

f x
  | head (head x) == '.' && head (last x) == '#' = init (tail x)
  | head (head x) == '.' = tail x
  | head (last x) == '#' = init x
  | otherwise = x