#include <bits/stdc++.h>
int getNumsInt32(int32_t *buf, int32_t num) {
  int32_t i;
  for (i = 0; i < num; i++) {
    if (scanf("%d", &buf[i]) == EOF) {
      return -1;
    }
  }
  return 0;
}
int main() {
  int32_t num, i, j, LenBlack = 0, LenWhite = 0, change = 0;
  char s[200000];
  if (getNumsInt32((int32_t *)&num, (int32_t)1) == -1) {
    return -1;
  }
  if (scanf("%s", s) == EOF) {
    return -1;
  }
  for (i = 0; i < num; i++) {
    if (s[i] == '.' && LenBlack == 0) continue;
    if (s[i] == '#') {
      LenBlack++;
    } else {
      for (j = i; j < num; j++) {
        if (s[j] == '.') {
          LenWhite++;
        } else {
          break;
        }
      }
      i = j;
      if (LenBlack > LenWhite) {
        change += LenWhite;
      } else {
        change += LenBlack;
      }
      LenBlack = 0;
      LenWhite = 0;
    }
  }
  printf("%d\n", change);
  return 0;
}
