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

const n = Number(input[0]);
const s = input[1];

console.log(calcStoneNum(s));

function calcStoneNum(s: string) {
    let trimmedS = s;
    for (let i = 0; i < s.length; i++) {
        if (s[i] === ".") {
            trimmedS = trimmedS.slice(1);
        } else {
            break;
        }
    }
    for (let i = s.length - 1; i >= 0; i--) {
        if (s[i] === "#") {
            trimmedS = trimmedS.slice(0, -1);
        } else {
            break;
        }
    }
    let blackCnt = 0;
    for (const char of trimmedS) {
        if (char === "#") {
            blackCnt++;
        }
    }
    return Math.min(blackCnt, trimmedS.length - blackCnt);
}