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