main :: IO ()
main = do
  _ <- getLine
  s <- getLine
  let
    s1 = reverse s
    s2 = dropWhile (== '#') s1
    s3 = filter (=='#') s2
    c1 = length s3

    t1 = dropWhile (== '.') s
    t2 = filter (== '.') t1
    c2 = length t2
  print $ minimum [c1, c2]
