import scala.util.control.Breaks

object Main extends App {
  var n = scala.io.StdIn.readInt()
  var s = scala.io.StdIn.readLine()
  var count = 0
  val b = new Breaks
  b.breakable{
    while(true) {
      if(s.indexOf("#.") < 0) {
        b.break()
      } else {
        if(s.indexOf("#.#") >= 0) {
          s = s.replaceFirst("#\\.#", "###")
          count = count + 1
        } else if (s.indexOf("#..") >= 0) {
          s = s.replaceFirst("#\\.\\.", "...")
          count = count + 1
        } else {
          s = s.replaceFirst("#\\.", "¥¥")
          count = count + 1
        }
      }

    }

  }
  print(count)
}
