object Main extends App {
  val inputs: Seq[String] = scala.io.Source.stdin.getLines().toList
  val N = inputs(0).toInt
  val S = inputs(1)
 
  println(solve(N,S))
 
  def solve(length: Int, rocks: String): Int  = {
    var varRocks = rocks
    var resultWhite = 0
    var resultBrack = 0
    // 白にする
    while (varRocks.contains("#.")) {
      resultWhite = resultWhite + varRocks.split("#.").length -1
      varRocks = varRocks.replaceAll("#.", "..")
    }
    // 黒にする
    varRocks = rocks
    while (varRocks.contains("#.")) {
      resultBrack = resultBrack + varRocks.split("#.").length -1
      varRocks = varRocks.replaceAll("#.", "##")
    }
 
    val result = if (resultBrack < resultWhite) resultBrack else resultWhite
    if (result <= 0) {
      0
    } else {
      result
    }
  }
}