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