fun main(args: Array<String>) {
    val n=readLine()!!.toInt()
    val s=readLine()!!
    val w = s.count { it=='.' }
    val b = s.count { it=='#' }
    val arr = IntArray(n+1){0}
    var wc =w
    var bc=0
    arr[0]=w
    if(w==n)arr[0]=0
    for(i in 0 until n){
        if(s[i]=='.')wc-=1
        else bc+=1
        arr[i+1]=wc+bc
    }
    print(arr.min())
}