import qualified Data.ByteString as B
import qualified Data.ByteString.Char8 as C
import Data.Traversable

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