#include <bits/stdc++.h>
int main(void) {
  int n, i, j;
  char s[200000];
  char a = '.';
  char b = '#';
  int cnt = 0;
  int acount = 0;
  int bcount = 0;
  scanf("%d", &n);
  scanf("%s", s);
  for (j = 0; j < n; j++) {
    if (s[j] == a) {
      acount++;
    }
    if (s[j] == b) {
      bcount++;
    }
  }
  for (i = 0; i < n; i++) {
    if (s[i] != s[i + 1]) {
      if (acount <= bcount) {
        if (s[i] == a) {
          cnt++;
          s[i] = b;
        }
      } else {
        if (s[i] == b) {
          cnt++;
          s[i] = a;
        }
      }
    }
  }
  printf("%d\n", cnt);
  return 0;
}
