import scala.io._
object Main extends App {
  val n = StdIn.readLine.toInt
  val s = StdIn.readLine

  def checkMin(i: Int, changes: Int, min: Int): Int = {
    if (i == n) min
    else {
      val newChanges = changes + (if (s.charAt(i) == '#') 1 else -1)
      checkMin(i + 1, newChanges, min.min(newChanges))
    }
  }
  val ws = s.count(_ == '.')
  println(checkMin(0, ws, ws))
}