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