main = do
  nIn <- getLine
  s <- getLine
  let
    n = head $ map read $ words nIn :: Int
    count c ls ret
      | ls == [] = ret
      | head ls == c = count c (tail ls) (ret+1)
      | otherwise = count c (tail ls) ret
    -- cnt1 : left b to w , cnt2 : right w to b
    fun s cnt1 cnt2 ret
      | s == [] = min (cnt1+cnt2) ret
      | head s == '#' = fun (tail s) (cnt1+1) cnt2 (min (cnt1+cnt2) ret)
      | head s == '.' = fun (tail s) cnt1 (cnt2-1) (min (cnt1+cnt2) ret)
    in
    putStrLn $ show $ fun s 0 (count '.' s 0) n
