function myout(text){console.log(text);}//standard output
function Main(input) {
	//input = parseInt(input);
	//input = input.trim().split(" ");
	input = input.trim().split("\n");
	//input = input.trim().split(" ").map((a)=>Number(a));
	//input = input.trim().split("\n").map((a)=>Number(a));
  var N = parseInt(input[0]);
  var s = input[1];
  var output = 0;
  if(s.indexOf(".") == -1 || s.indexOf("#") == -1){
     //片方しかない場合は処理なし
    myout(output);
    return;
  }else{
    var lastBlack = 0;
    for(var i = 0; i < N; i++){
      var tmp = s.slice(i,i+1);
      if(tmp == "#"){
         lastBlack = i+1;
         continue;
      }else if(tmp == "." && lastBlack >= 1){
        output++;
      }
    }
    myout(output);
  }
  
}

Main(require("fs").readFileSync("/dev/stdin", "utf8").trim());
