"use strict";
function Main(input) {
    let cin = new Inputer(input);
    let N = cin.getInt(), S = cin.getStr();
    const W = ".", B = "#";
    let count = {}; count[W] = 0, count[B] = 0;
    for (let n = 0; n < N; n++) count[S.charAt(n)]++;
    for (let n = 0; n < N && S.charAt(n) == W; n++) count[W]--;
    for (let n = N - 1; n >= 0 && S.charAt(n) == B; n--) count[B]--;
    console.log(count[W] < count[B] ? count[W] : count[B]);
}
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"));