module Main where

import           Control.Monad
import           Data.List
import           Data.Ord
import           Data.List.Split
import           Data.Array.IO
import qualified Data.Vector            as V
import           Data.Maybe
import           Text.Printf

main :: IO ()
main = do
  _ <- getLine
  s <- getLine
  let ids = createIds s
      vs = V.fromList s
  as <- forM ids $ \x ->
    return $ (V.length . V.elemIndices '#' $ V.take x vs) + (V.length . V.elemIndices '.' $ V.drop x vs)
  print $ minimum as
  where
    createIds (c:ss) = loop 1 c ss
    loop i c [] = [i]
    loop i c (s:ss) | c == s = loop (i + 1) s ss
                  | otherwise = i:loop (i + 1) s ss
