import Control.Arrow
import Control.Monad
import Data.List
import qualified Data.ByteString.Char8 as B

main :: IO ()
main = getLine >> getLine >>= print . solve

solve :: String -> Int
solve s = minimum $ calc cs 0
    where
        calc (y : ys) z = (wr + bl) : calc ys (z + 1)
            where
                wr = wn - y
                bl = z - y
        calc _ _ = []

        bs = map (== '.') s 
        wn = length $ filter id bs
        bn = length $ filter not bs
        cs = scanl sf 0 bs
        sf acc x 
            | x = acc + 1
            | otherwise = acc

readLine :: IO [Int]
readLine = unfoldr (fmap (second (maybe B.empty snd . B.uncons)) . B.readInt) <$> B.getLine

readContents :: Int -> IO [[Int]]
readContents = flip replicateM readLine