fun main(args: Array<String>){
    val n = readLine()!!.toInt()
    var s = readLine()!!
    var cntp = 0
    var cnts = 0
    var flag = 0

    if(s[0] == '#'){
        for(i in 0..n-1){
            if(s[i] == '.'){
                cntp++
            }
            else{
                cnts++
            }
        }
        if(cntp < cnts){
            println(cntp)
        }
        else{
            println(cnts)
        }
    }
    else{
        for(i in 0..n-1){
            if(s[i] == '#'){
                flag = i
                cntp = i
                break
            }
        }
        for(i in flag..n-1){
            if(s[i] == '.'){
                cntp++
            }
            else{
                cnts++
            }
        }
        if(cntp < cnts){
            println(cntp-flag)
        }
        else{
            println(cnts)
        }
    }
}