#include <bits/stdc++.h>
int main(void) {
  char st[100000];
  int i, n, cnt[100000];
  scanf("%d%*c%s%*c", &n, st);
  int s = 0;
  for (i = 0; i < n; i++) {
    if (st[i] == '#') s++;
    cnt[i] = s;
  }
  s = 0;
  for (i = n - 1; i >= 0; i--) {
    if (st[i] == '.') s++;
    cnt[i] += s;
  }
  int min = 100000;
  for (i = 0; i < n; i++) {
    if (min > cnt[i]) min = cnt[i];
  }
  printf("%d", min - 1);
  return 0;
}
