import scala.io.StdIn

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

  def solve2(s: String): Int = {
    var p  = '.'
    var ac = 0
    var index = 0
    var min = Int.MaxValue

    if (s.contains("#.")) {
      s.foreach {v =>
        if (v == '#') {
          ac += 1
        } else { // v = '.'
          if (p == '#') {
            var l = s.slice(index + 1, s.length() + 1).filter(_ == '.').length()
            var r = ac
            if (min > l + r) min = l + r
          }
        }
        p = v;
        index += 1
      }
      min
    } else {
      0
    }
  }

  
  println(solve2(s))


}

  


