fun main(args: Array<String>) {
    tenka12019beginnerc()
}

fun tenka12019beginnerc() {
    val n = readLine()!!.toInt()
    val s = readLine()!!

    var leftSharp = 0
    var rightPeriod = s.count { it == '.' }
    var answer = leftSharp + rightPeriod
    for (i in 0..s.lastIndex) {
        if (s[i] == '#') leftSharp++ else rightPeriod--
        val count = leftSharp + rightPeriod
        answer = Math.min(answer, count)
    }

    println(answer)
}
