#include <bits/stdc++.h>
int main() {
  int n;
  char *s;
  int i, j, k;
  int alpha = 0;
  int beta = 0;
  int ans;
  scanf("%d", &n);
  ans = n;
  s = (char *)malloc(sizeof(char) * n);
  scanf("%s", s);
  for (i = 0; i < n; i++) {
    for (j = 0; j < i; j++) {
      if (s[j] == '#') alpha++;
    }
    for (k = i; k < n; k++) {
      if (s[k] == '.') beta++;
    }
    if (alpha + beta < ans) ans = alpha + beta;
  }
  printf("%d\n", ans);
  return 0;
}
