"use strict";
function Main(input) {
    let cin = new Inputer(input);
    let N = cin.getInt(), S = cin.getStr();
    let W = new Array(N + 1).fill(0);
    for (let n = 0; n < N; n++)
        W[n + 1] = W[n] + (S.charAt(n) == '#' ? 1 : 0);
    let ans = Number.MAX_SAFE_INTEGER;
    for (let n = 0; n <= N; n++)
        ans = Math.min(ans, W[n] + N - n - (W[N] - W[n]));
    console.log(ans);
}
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"));