import scala.io.StdIn

object Main extends App {
  val n  = StdIn.readLine().toInt
  val s  = StdIn.readLine()

  def solve(s: String): Int = {

    if (s.contains(".#")) {
      val rep = s.replace(".#", "a")
      val wi = rep.zipWithIndex.filter(_._1 == 'a').map(_._2)
      var min = Int.MaxValue

      wi.foreach { v =>
        val l = rep.slice(0, v).filter(_ == '#').length
        val r = rep.slice(v + 1, rep.length + 1).filter(_ == '.').length
        if (min > l + r) min = l + r

      }
      min
    } else {
      return 0
    }
  }
  println(solve(s))
}

  


