import scala.io._
object Main extends App {
  StdIn.readLine
  val s = StdIn.readLine
  val mlb = s.indexOf('#')
  val mrw = s.lastIndexOf('.')
  println(s.drop(mlb).count(_ == '.') min s.take(mrw).count(_ == '#'))
}