import qualified Data.ByteString as B
import qualified Data.ByteString.Char8 as C
import Data.Traversable

main :: IO ()
main = do
  _ <- B.getLine
  s <- B.init <$> B.getLine
  let (a, b, c) = C.foldl go (0, 0, 0) s
  print $ minimum [a, b, c]

go :: (Int, Int, Int) -> Char -> (Int, Int, Int)
go (a, b, c) '#' = (min a b, b + 1, c)
go (a, b, c) '.' = ((min a b) + 1, b , c + 1)
