fun main(args: Array<String>) {
    val n = readLine()!!.toInt()
    var l = readLine()!!
    var whiteOnRight = l.count{it == '.'}
    var blackonLeft = 0
    var a = Int.MAX_VALUE

    for(i in 0 until n){
        if (l[i] == '.') {
            whiteOnRight -= 1
        }
        else{
            blackonLeft += 1
        }
        a = Math.min(whiteOnRight + blackonLeft, a)
    }
    println(a)
}