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 dot = 0; var sharp = 0;

    for (var i = 0; i < N; i++) {
        
        if (S[i] === "#") {
            for (var j = i; j < N; j++) {
                if (S[j] === ".") { dot++; }
                else { sharp++; }
            }
            break;
        }
    }
    console.log(Math.min(dot, sharp));
});