import Data.List
main = do
  _ <- getLine
  s <- getLine
  let gs = group s
  let gss = if head (head gs) == '.' then tail gs else gs
  let gsss = if last (head gss) == '#' then init gss else gss
  let w = sum $ map length (filter (\x -> head x == '.') gss)
  let b = sum $ map length (filter (\x -> head x == '#') gss)
  let ww = sum $ map length (filter (\x -> head x == '.') gsss)
  let bb = sum $ map length (filter (\x -> head x == '#') gsss)
  print $ minimum [w,b,ww,bb]
