import java.util.Collections

import scala.io.StdIn

object Main {
  def main(args: Array[String]) = {
    val N = StdIn.readInt
    val S = StdIn.readLine.toCharArray
    var ans = 0
    for(i <- 0 until N - 1) {
      val j = i + 1
      if (S(i) == '#' && S(j) == '.') {
        ans+=1
      }
    }

    println(ans)
  }
}
