const p = (...args) => {
  process.env.NODE_ENV === "test" ? console.log(...args) : ""
}

const solve = (s) => {
  let b = false
  let cnt = 0
  s.split("").map((c) => {
    if (c == "#" && !b) {
      b = true
    }
    if (c == "." && b) {
      cnt++
    }
  })
  return cnt
}
const main = (input) => {
  const [n, s] = input.split("\n")

  return solve(s || "")
}

if (process.env.NODE_ENV !== "test") {
  const input = require("fs").readFileSync("/dev/stdin", "utf8")
  console.log(main(input.trim()))
}

