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