function Main(input) {
    input = input.split("\n");
    var arr = Array.from(input[1]);
    var count = 0;

    arr.forEach(function(item, index) {
        if (index != arr.length) {
            if (item == "#" && arr[index + 1] == ".") {
                count = count + 1;
            }
        }
    });
    console.log(count);
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));
