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