import Data.List(findIndex)

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