var main = standardInput => {
  var input = standardInput.split("\n").map(function(v) {
    return v;
  });
  
  var N = parseInt(input[0],10);
  var S = input[1];

  var changecount = 0;
  var blackflag = false;

  for (var i = 0; i <= N - 1; i++) {
    if(blackflag === false && S[i] === "#"){
      blackflag = true;
    } else if(blackflag === true && S[i] === "."){
      changecount += 1;
    }
  }
  console.log(changecount);
};
main(require("fs").readFileSync("/dev/stdin", "UTF-8"));

