import Data.List

main :: IO ()
main = do
  n <- readLn
  s <- getLine
  let
    bn = length $ filter (== '#') s
    (c, _, _) = foldl' go (bn, 0, 0) s
    go (ans, cbn, i) '#' = (min ans (cbn + 1 + ((n - i - 1) - (bn - cbn - 1))), cbn + 1, i + 1)
    go (ans, cbn, i) '.' = (min ans (cbn + 0 + ((n - i - 1) - (bn - cbn - 0))), cbn + 0, i + 1)
  print c
