import           Control.Monad
import qualified Data.ByteString.Char8 as BS
import           Data.Foldable
import           Data.Maybe

readInt = fst . fromJust . BS.readInt
getInt = readInt <$> BS.getLine

main = do
  n <- getInt
  s <- getLine

  let nW = length $ filter (== '.') s

      solve nB nW [] res = min res (nB + nW)
      solve nB nW (c:cs) res | c == '.' = solve nB (nW-1) cs (min res (nB + nW))
                             | c == '#' = solve (nB+1) nW cs (min res (nB + nW))

  print $ solve 0 nW s (10^9)