fun main(args: Array<String>){

//    var (H, W) = readLine()!!.split(" ").map{it.toInt()}
    var N = readLine()!!.toInt()
    var S = readLine()!!.toCharArray()
    var whiteCount = IntArray(N){0}
    var blackCount = IntArray(N){0}

    if(S[0] == '.'){
        whiteCount[0] = 1
    } else {
        blackCount[0] = 1
    }

    for(i in 1 until N){
        if(S[i] == '.'){
            whiteCount[i] = whiteCount[i-1] + 1
            blackCount[i] = blackCount[i-1]
        } else {
            whiteCount[i] = whiteCount[i-1]
            blackCount[i] = blackCount[i-1] + 1
        }

    }

    var ans = whiteCount[N-1]
    for(i in S.indices){
        var tmpans = blackCount[i] + whiteCount[N-1] - whiteCount[i]
        ans = Math.min(ans,tmpans)
    }

    println(ans)


}