function Main(input) {
    const N = parseInt(input[0])
    const S = input[1]
    
    var BW = [];
    if(S.charAt(0) == "."){
        BW.push(0);
    }

    var prev = S.charAt(0);
    var count = 0;
    for (let i = 0; i < N; i++) {
        const element = S.charAt(i);
        if(element == prev){
            count++
        } else {
            BW.push(count);
            prev = element;
            count = 1;
        }
    }
    if(count > 0) {
        BW.push(count);
    }
    if(BW.length %2 > 0){
        BW.push(0);
    }


    var min = Number.MAX_SAFE_INTEGER;

    for (let i = 0; i < BW.length/2 + 1; i++) {
        var sum = 0;
        for (let j = 0; j < BW.length/2; j++) {
            sum += i <= j ? BW[j*2] : BW[j*2+1];
        }
        
        min = Math.min(sum, min);
    }

    console.log(min);
    
}

// 改行・空白で分割
Main(require("fs").readFileSync("/dev/stdin", "utf8").trim().split(/\n|\s/));