function main(input) {
  const S = input.split("\n")[1];
  const i = S.indexOf("#");
  const S2 = S.slice(i);
  const splitDot = S2.split(".");
  const splitHush = S2.split("#");
  const fix = splitDot && splitDot[splitDot.length - 1][0] === "#" ? splitDot[splitDot.length - 1].length : 0;
  console.log((i === -1) ? 0 : Math.min(splitDot.length - 1, splitHush.length - 1 - fix);
}
main(require("fs").readFileSync("/dev/stdin", "utf8").trim());
