import scala.io._
object Main extends App {
  val n = StdIn.readLine.toInt
  val s = StdIn.readLine
  val nb = s.count(_ == '#')
  val nw = n - nb

  def checkMin(i: Int, changes: Int): Int = {
    if (i == n) changes
    else {
      checkMin(i + 1, changes + (if (s.charAt(i) == '#') 1 else -1))
    }
  }
  println(checkMin(0, nw))
}