main = do
    n <- readLn
    s <- getLine
    print $ editorial n s


editorial :: Int -> String -> Int
editorial n s = let cntW = length $ filter (=='.') s
    in minimum $ trav (0,cntW) s

trav :: (Int,Int) -> String -> [Int]
trav (lb,rw) [] = [lb+rw]
trav (lb,rw) (h:t) =
        let p = if h=='#' then (lb+1,rw) else (lb,rw-1)
        in (lb+rw):(trav p t)