function Main(input) {
    const N = parseInt(input[0])
    const S = input[1]
    
    var count = 0;
    var isDirty = false;
    for(var i = 0; i < N; i++){
        if(isDirty && S.charAt(i) == ".") {
            count ++;
        } else if (S.charAt(i) == "#") {
            isDirty = true;
        }
    }
    console.log(count);
}

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