import Data.Traversable

main :: IO ()
main = do
  n <- readLn
  s <- getLine
  c <-
    for [0 .. n] $ \i -> do
      let
        (a, b) = splitAt i s
        an = length $ filter (== '#') a
        bn = length $ filter (== '.') b
      pure $ an + bn
  print $ minimum c
