object Main extends App {
  var n = scala.io.StdIn.readInt()
  var s = scala.io.StdIn.readLine()

  val firstIndexSharp = s.indexOf("#")
  if(firstIndexSharp < 0) {
    print(0)
  } else {
    val countTarget = s.substring(firstIndexSharp, n)
    val whiteCount = countTarget.count(_ == '.')

    val lastIndexComma = countTarget.lastIndexOf(".")
    val countTarget2 = countTarget.substring(lastIndexComma + 1)
    var blackCount = countTarget2.count(_ == '#')

    if (whiteCount > blackCount) {
      print(blackCount)
    } else {
      print(whiteCount)
    }
  }
}