function Main(input) {
    const N = parseInt(input[0])
    const S = input[1]
    
    var white = 0;

    for (var index = 0; index < N; index++) {
        const element = S[index];
        white += element == "." ? 1 : 0;
    }

    var black = 0;
    var result = white;
    for (var index = 0; index < N; index++) {
        const element = S[index];
        if(element == ".") {
            white--;
        } else {
            black++;
        }
        result = Math.min(result, white + black);
    }

    console.log(result);
}

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