function Main(input) {
  line = input.split('\n');
  a = line[0] * 1
  b = line[1]
  c = 0,d =0
  for(i=0;i<a;i++) {
    if (b[i]=='.') {
      b=b.slice(i)
    } else {
  b=b.slice(i)
      break
    }
  }
  for(i=a;0<=i;i--) {
    if (b[i]=='#') {
      b=b.slice(0,i-1)
    } else {
       break;
    }
  }
  for(i=0;i<b.length;i++) {
    if (b[i]=='.') {
      c++
    } else {
      d++
    }
  }
  console.log(Math.min(c,d))
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));
