function Main(input) {
  input = input.split("\n");
  var N = parseInt(input[0].split(" ")[0]);
  var S = input[1].split(" ")[0];

  var count_All_white = S.split("#").length-1;

  var count_dot=0;
  for(var i=0; i < S.length; i++){
    if(S[i] == "#") break;
    count_dot++;
  }

  var count_sharp = S.length-1;
  for(var i=S.length-1; i == 0; i--){
    if(S[i] == ".") break;
    count_sharp--;
  }

  var sharp_num=0;
  var dot_num=0;
  for(var i=count_dot;i<count_sharp+1;i++){
    if(S[i] == "#") sharp_num++;
    if(S[i] == ".") dot_num++;
  }

  console.log(Math.min(count_All_white,sharp_num, dot_num));
}

var input=Main(require("fs").readFileSync("/dev/stdin", "utf8"));
// var input=`3
// #.#`
// Main(input);
