#include <bits/stdc++.h>
int main() {
  int n, i, min = 0, white = 0, black = 0;
  scanf("%d", &n);
  char s[n];
  scanf("%s", &s);
  for (i = 0; i < n; i++) {
    if (s[i] == '.') {
      white++;
    }
  }
  black = n - white;
  i = white;
  while (s[i] == '.') {
    black--;
    i++;
  }
  for (i = 0; i < white; i++) {
    if (s[i] == '#') {
      min++;
    }
  }
  for (i = n - 1; i > n - black; i--) {
    if (s[i] == '.') {
      min++;
    }
  }
  printf("%d", min);
  return 0;
}
