main = do
  getLine
  s<-getLine
  print$solve s

solve s = minimum $ zipWith (+) toW toB
  where
  toW = scanl (\n c->if c=='#' then n+1 else n) 0 s
  toB = scanr (\c n->if c=='.' then n+1 else n) 0 s