import Data.List
main = do
  n <- readLn
  s <- getLine
  let gs = group s
  print $ minimum (map (f gs) [0..n])
f zs y = sum (map length (filter (\x -> head x == '#') (take y zs))) + sum (map length (filter (\x -> head x == '.') (drop y zs)))
