#include <bits/stdc++.h>
int main() {
  int n, i = 0, w = 0, b = 0, max = 0, ans, tmp = 0;
  char s[n];
  scanf("%d", &n);
  scanf("%s", s);
  while (s[i] = '.') {
    i++;
  }
  for (i; i < n; i++) {
    if (s[i] == '#') {
      b = b + 1;
    } else {
      w = w + 1;
    }
    if (b = w) {
      max = i + 1;
      tmp = b;
    }
  }
  b = 0;
  w = 0;
  for (i = max; i < n; i++) {
    if (s[i] = '#') {
      b = b + 1;
    } else {
      w = w + 1;
    }
  }
  if (b > w) {
    ans = w + tmp;
  } else {
    ans = b + tmp;
  }
  printf("%d", &ans);
  return 0;
}
