var lines = [];
var readline = require('readline');

var rl = readline.createInterface({
    input: process.stdin,
    output: process.stdout,
});

rl.on('line', function (x) {
    lines.push(x);
});

rl.on('close', function () {
    var N = Number(lines[0]);
    var S = lines[1].split("");

    var result =0;
    for (var i = 0; i < N-1; i++) {
        if (S[i] === "#" && S[i + 1] === ".") { result++; }
    }

    console.log(result);
});