#include <bits/stdc++.h>
int main() {
  int n, i, j, r, ans = 1e9, a, b, c, d, e, f, count;
  char s[200005];
  scanf("%d", &n);
  scanf("%s", s);
  for (i = 0; i < n - 1; i++) {
    a = b = 0;
    if (i) {
      for (j = i - 1; j >= 0; j--) {
        if (s[j] == '#') {
          a++;
        }
      }
    }
    for (r = i; r < n; r++) {
      if (s[r] == '.') {
        b++;
      }
    }
    ans = (ans > a + b) ? a + b : ans;
    if (s[i] == '.') {
      count++;
    }
  }
  for (i = 0; i < n - 1; i++) {
    if (s[i] == '.') {
      c++;
      d = i;
    }
    if (s[i] == '#') {
      e++;
      f = i;
    }
  }
  if ((c == 1 && d == 0) || (e == 1 && f == n - 1) || (count == n)) {
    ans = 0;
  }
  printf("%d\n", ans);
  return 0;
}
