import Control.Monad

main = do 
    n <- readLn :: IO Int
    s <- getLine
    let ts = reverse $ dropWhile (\x-> x == '#') $ reverse $ dropWhile (\x-> x == '.') s
    let res = cnt ts (0,0)
    --print $ ts
    --print $ res
    print $ min (fst res) (snd res)

cnt :: String -> (Int,Int) -> (Int, Int)
cnt [] (b,w) = (b,w)
cnt (x:xs) (b,w) = if x == '#' then cnt xs (b+1,w) else cnt xs(b,w+1) 