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 start = s.indexOfFirst { it == '#' }
    var end = s.indexOfLast { it == '.' }
    var leftBlack = 0
    var leftWhite = 0
    var rightBlack = 0
    var rightWhite = 0
    while (start < end) {
        if (s[start] == '#') leftBlack++ else leftWhite++
        if (s[end] == '#') rightBlack++ else rightWhite++
        start++
        end--
    }
    if (start == end) if (s[start] == '#') leftBlack++ else leftWhite++
    val count = min(leftBlack, rightWhite) + min(rightWhite, rightBlack)
    println(count)
}