#include <bits/stdc++.h>
int main(void) {
  int n;
  scanf("%d", &n);
  char s[n];
  scanf("%s", s);
  int w = 0;
  for (int i = 0; i < n; i++) {
    if (s[i] == '.') {
      w++;
    }
  }
  int b = (n - w);
  int min = n, lb = 0, rw = w, now;
  for (int i = 0; i < n; i++) {
    if (s[i] == '#') {
      lb++;
    } else {
      rw--;
    }
    now = (lb + rw);
    if (min > now) {
      min = now;
    }
  }
  printf("%d\n", min);
  return 0;
}
