#include <bits/stdc++.h>
int main() {
  long int n, a = 0, b = 0, ans, c = 0, d = 0;
  scanf("%ld", &n);
  char s[20000];
  scanf("%s", s);
  for (int i = n - 1; i >= 0; i--) {
    if (s[i] == '.') {
      c = i;
      break;
    }
  }
  for (int i = 0; i < n; i++) {
    if (s[i] == '#') {
      d = i;
      break;
    }
  }
  for (int i = d; i <= c; i++) {
    if (s[i] == '.')
      a++;
    else
      b++;
  }
  ans = (a < b) ? a : b;
  printf("%ld", ans);
}
