"use strict";
function Main(input) {
    let cin = new Inputer(input);
    let N = cin.getInt(), S = cin.getStr();
    let white = 0, black = 0;
    const W = ".", B = "#";
    for (let n = 0; n < N; n++) {
        if (S.charAt(n) == W) white++; else black++;
    }
    let n = S.length - 1;
    while (n > 0 && S.charAt(n) == B) black--, n--;
    console.log((white < black) ? white : black);
}
class Inputer{constructor(t){this.cnt=0,this.items=t.split(/\n|\s/)}getInt(){return this.items[this.cnt++]-0}getIntArray(t){let r=new Array(t);for(let e=0;e<t;e++)r[e]=this.getInt();return r}getStr(){return this.items[this.cnt++]}getStrArray(t){let r=new Array(t);for(let e=0;e<t;e++)r[e]=this.getStr();return r}}
if (typeof window == "undefined") Main(require("fs").readFileSync("/dev/stdin", "utf8"));