import scala.io.StdIn

object Main extends App {

  val n  = StdIn.readLine().toInt
  val s  = StdIn.readLine()

  def solve(s: String): Int = {
    val wi = s.zipWithIndex.filter(_._1 == '.').map(_._2)
    var min = Int.MaxValue

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

    }
    min

  }

  println(solve(s))
}
  


