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

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

    val (black, white) = s.partition { it == '#' }

    val answer = Math.min(black.length, white.length)

    println(answer)
}
