fun main() {
    val n = readLine()?.toInt() ?: return
    val s = readLine() ?: return
    var wC = s.count { it == '.' }
    var bC = 0
    var count = bC + wC
    0.until(n).forEach {
        when (s[it]) {
            '.' -> wC--
            '#' -> bC++
        }
        count = min(count, bC + wC)
    }
    println(count.toString())
}
