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