import Data.List(findIndex)

main = do
    _ <- getLine
    s <- getLine
    let resB = case findIndex (=='#') s of
                Nothing -> 0
                Just n -> length $ filter (=='.') $ drop n s
    let resW = length $ filter (=='#') s
    print $ min resB resW
