#include <bits/stdc++.h>
int count_rightwhite(int i, int n, const char s[]) {
  int cnt = 0;
  int j;
  for (j = i; j < n; j++) {
    if (s[j] == '.') cnt++;
  }
  return cnt;
}
int count_leftblack(int i, int n, const char s[]) {
  int cnt = 0;
  int j;
  for (j = i - 1; j >= 0; j--) {
    if (s[j] == '#') cnt++;
  }
  return cnt;
}
int main(void) {
  int n;
  char s[200001];
  scanf("%d", &n);
  scanf("%s", s);
  int cntmin = n;
  int i;
  for (i = 0; i <= n; i++) {
    int tmp = count_rightwhite(i, n, s) + count_leftblack(i, n, s);
    if (cntmin > tmp) cntmin = tmp;
  }
  printf("%d\n", cntmin);
  return 0;
}
