function main(input) {
  const s = [].slice.call(input.split(/\n/)[1]) 
  var c = 0
  
  for (var i=0; i<s.length; i++) {
    if (s[i] === "#") {
      if (s.length - i < 2) {
        continue
      }
      
      if (s[i+1] === "." && s[i+2] === ".") {
        c++
        s[i] = "."
      }
    } else {
      if (i - 1 < 0) {
        continue
      }
      
      if (s[i-1] === "#") {
        c++
        s[i] = "#"
      }
    }
  }
  
  console.log(c)
}

main(require("fs").readFileSync("/dev/stdin", "utf8"));