#include <bits/stdc++.h>
int main() {
  int n, a = 0;
  char s[200100];
  scanf("%d", &n);
  scanf("%s", s);
  int i = 0, nd[200000];
  int nn = 0;
  while (i < n) {
    nd[nn] = 0;
    while (i < n && s[i] == '.') {
      i++;
      nd[nn]++;
    }
    nn++;
    nd[nn] = 0;
    while (i < n && s[i] == '#') {
      i++;
      nd[nn]++;
    }
    nn++;
  }
  for (i = 0; i < nn; i += 2) a += nd[i];
  int b = a;
  for (i = 0; i < nn; i += 2) {
    b = b - nd[i] + nd[i + 1];
    if (b < a) a = b;
  }
  printf("%d\n", a);
  return 0;
}
