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

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

    var left = 0
    while (left <= s.lastIndex && s[left] == '.') left++

    val slice = s.slice(left..s.lastIndex)

    val count = slice.count { it == '.' }

    val answer = Math.min(count, slice.length - count)

    println(answer)
}
