object Main extends App {
  var n = scala.io.StdIn.readInt()
  val s = scala.io.StdIn.readLine()
  var target = s
  if (s.indexOf("#.#") >= 0) {
    target = target.replaceAll("#\\.#", "##")
  }
  if (s.indexOf("#..") >= 0) {
    target = target.replaceAll("#\\.\\.", "..")
  }
  if (s.indexOf("#.") >= 0) {
    target = target.replaceFirst("#\\.", "#")
  }
  print(s.length - target.length)
}