#include <bits/stdc++.h>
int main() {
  int n, i, j, q, r;
  char s[200001];
  scanf("%d%s", &n, s);
  int c[200001] = {}, m = 0;
  r = n;
  for (i = 0; i < n - 1; i++) {
    if (s[i] != s[i + 1]) {
      c[m]++;
      m++;
    }
  }
  for (i = 0; i < m; i++) {
    q = 0;
    for (j = 0; j < n; j++) {
      if (j < c[i] && s[j] == '#') q++;
      if (j >= c[i] && s[j] == '.') q++;
    }
    if (q < r) r = q;
  }
  printf("%d", r);
  return 0;
}
