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
    }
    val start = s.indexOfFirst { it == '#' }
    val end = s.indexOfLast { it == '.' }
    if (start < end) {
        val area = s.substring(start, end + 1)
        val blacks = area.count { it == '#' }
        println(min(blacks, area.length - blacks))
    } else {
        println(0)
    }
}