function C(x) {
    x = x.split("\n");
    N = x[0], S = x[1];
    
    var Wcount = 0, Bcount = 0, ans = 0;
    for (let i = 0; i < N; i++) if (S[i] === '.') Wcount++;
    // console.log(`${Wcount}`);
    for (let i = 0; i < N; i++) {
        if(S[i] === '.') Wcount--; 
        else Bcount++;
        // console.log(`${Wcount}:${Bcount}`);
        if(!ans) ans = Wcount + Bcount;
        else if(ans > Wcount + Bcount) ans = Wcount + Bcount;
    }
    console.log(`${ans}`);
    
    // console.log(`${N} ${S}`);
}
C(require("fs").readFileSync("/dev/stdin", "utf8"));