import kotlin.math.min

fun main() {
    tenka1_2019c()
}

fun tenka1_2019c() {
    val n = readLine()!!.toInt()
    val s = readLine()!!
    if (!s.contains('#') || !s.contains('.')) {
        println(0)
        return
    }
    var rw = s.count { it == '.' }
    var count = rw
    var lb = 0
    for (i in 0 until n) {
        if (s[i] == '.') {
            rw--
        } else {
            lb++
        }
        count = min(count, rw + lb)
    }
    println(count)
}