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

    var found = false
    for (i in n - 1 downTo 1) {
        val sub = s.substring(i - 1, i + 1)
        if (sub == "#.") {
            found = true
            break
        }
    }

    if (!found) {
        println("0")
        return
    }

    val white = s.filter { it == '.' }.count()
    val black = n - white

    println(Math.min(white, black))
}