import Data.List
main = do
    getLine
    s <- getLine
    let wbs = scanr (\c (w,b) -> if c == '.' then (w+1,b) else (w,b+1)) (0,0) s
        b = snd $ head wbs
    print . minimum $ map (\(wi,bi) -> wi + (b-bi)) wbs