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