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

    var count_inverse = 0
    var flag = false

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


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

    print(Math.min(count, count_inverse))
}
