import * as fs from "fs";
const input = fs.readFileSync("/dev/stdin", "utf8").split("\n");

const n = Number(input[0]);
const s = input[1];
let blackCnt = 0;
let whiteCnt = 0;
let startBlack = false;
if (s.length < 2) {
    console.log(0);
} else {
    for (let i = 0; i < s.length; i++) {
        const char = s[i];
        if (!startBlack) {
            if (char === ".") {
                continue;
            }
            startBlack = true;
            blackCnt++;
            continue;
        }
        if (char === ".") {
            whiteCnt++;
        } else {
            blackCnt++;
        }
    }
    console.log(Math.min(blackCnt, whiteCnt));
}