function Main(input) {
  // 数字
  var N = parseInt(input[0], 10);
  var S = input[1];
  // 文字
  // var A = input[0];

  var result = 0;
  var continueWhite = false;

  for (var i = 1; i < S.length; i++) {
    if (S.charAt(i) === '.') {
      if (S.charAt(i - 1) === '#' || continueWhite) {
        result++;
        continueWhite = true;
      }
    } else {
      continueWhite = false;
    }
  }
  console.log(result);
}

Main(require("fs").readFileSync("/dev/stdin", "utf8").trim().split(/\n|\s/));