import java.util.regex.Pattern

fun main(args: Array<String>) {
    tenka12019beginnerc()
}

fun tenka12019beginnerc() {
    val n = readLine()!!.toInt()
    val s = readLine()!!

    val answer = Pattern.compile("#\\.+").matcher(s).results()
        .map { it.group().drop(1).length }
  		.reduce { t: Int?, u: Int? -> (t ?: 0) + (u ?: 0) }
        .orElse(0)

    println(answer)
}
