function Main(input) {
  var args = input.split('\n');
  var n = parseInt(args.shift());
  var s = args.shift();
  var bCount = 0;
  var wCount = 0;
  for(var sc of s) {
    if (!bCount && sc === '.') {
      continue;
    }
    if (sc === '#') {
      bCount++;
      continue;
    }
    wCount++;
  }
  console.log(wCount < bCount ? wCount : bCount);
}

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