main :: IO ()                                                                                                                                         
main = do                                                                                                                                             
  _ <- getLine                                                                                                                                        
  s <- getLine                                                                                                                                        
  let t = reverse s                                                                                                                                   
      n1 = length . filter (=='.') . dropWhile (=='#') . dropWhile (=='.') $ s                                                                        
      n2 = length . filter (=='#') . dropWhile (=='.') . dropWhile (=='#') $ t                                                                        
  print $ min n1 n2