fun main(args: Array<String>) {
    val n = readLine()!!.toInt()
    val s = readLine()!!.reversed()

    var count = 0
    var flag = false

    for (c in s) {
        if (c.toString() == ".") {flag = true}
        if(c.toString() == "#" && flag) {
            count += 1
        }
    }
    print(count)
}