"use strict";
    
const main = arg => {
    arg = arg.trim().split("\n");
    const N = ~~arg[0];
    const S = arg[1].split("");
    const rS = [...S].reverse();
    
    let flg1 = false;
    let hasBlack = false;
    let cnt1 = 0;
    
    for(let i=0; i<N; i++) {
        if(S[i] === "#" && !hasBlack) {
            hasBlack = true;
        }
        
        if(hasBlack) {
            if(!flg1 && S[i] === ".") {
                cnt1++;
                flg1 = true;
            } else if(flg1 && S[i] === ".") {
                cnt1++;
            }
        }
    }
    
    let flg2 = false;
    let hasWhite = false;
    let cnt2 = 0;
    
    for(let i=0; i<N; i++) {
        if(rS[i] === "." && !hasWhite) {
            hasWhite = true;
        }
        
        if(hasWhite) {
            if(!flg2 && rS[i] === "#") {
                cnt2++;
                flg2 = true;
            } else if(flg2 && rS[i] === "#") {
                cnt2++;
            }
        }
    }
    
    console.log(Math.min(cnt1, cnt2));
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));