main :: IO()
main = do
    getLine
    str <- getLine
    let kuro = countBlack str
        siro = (length str) - kuro
    print $ getsolve str siro 0 0


getsolve :: String -> Int -> Int -> Int -> Int
--ｓｔｒ→全体白→前半黒→前半白→回答
getsolve str allsiro maekuro maesiro
    | str == []					= maekuro + maesiro - allsiro
    | head str == '.'			= min nowstat (getsolve (tail str) allsiro maekuro (succ maesiro))
    | otherwise					= min nowstat (getsolve (tail str) allsiro (succ maekuro) maesiro)
    where nowstat = maekuro + (allsiro - maesiro)



countBlack :: String -> Int
countBlack str
    | str == []				= 0
    | head str == '.'		= countBlack $ tail str
    | otherwise				= 1 + (countBlack $ tail str)




