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