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

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

    var answer = Int.MAX_VALUE
    for (i in 0..s.lastIndex) {
        val count = s.slice(0..i).count { it == '#' } + s.slice(i + 1..s.lastIndex).count { it == '.' }
        answer = Math.min(answer, count)
    }

    println(answer)
}
