#include <bits/stdc++.h>
int main(void) {
  int n, i, j;
  scanf("%d", &n);
  char s[n];
  scanf("%s", s);
  int min = 1000000;
  int count = 0;
  int countfw;
  i = 0;
  if (s[0] == '.') {
    while (s[i] == '.') {
      i++;
    }
    countfw = i;
  }
  if (s[i] == '#') {
    while (s[i] == '#') {
      i++;
      if (s[n - 1] == '#') {
        min = 0;
      }
    }
  }
  for (j = countfw; j < n; j++) {
    if (s[j] == '.') {
      s[j] = '#';
      count++;
      puts("A");
    }
  }
  if (min > count) {
    min = count;
  }
  if (count * 2 > n) {
    min = n - count;
  }
  printf("%d", min);
  return 0;
}
