#include <bits/stdc++.h>
int main(void) {
  long long a, b = 0, c = 0, e = 0, f = 0, i;
  char d[1000010];
  scanf("%lld", &a);
  scanf("%s", d);
  for (i = 0; i < a; i++) {
    if (d[i] == '.') {
      b++;
    } else {
      c++;
    }
  }
  for (i = a - 1; i >= 0; i--) {
    if (d[i] == '.') e = 1;
    if (e == 1) {
      if (d[i] == '#') f++;
    }
  }
  printf("%lld\n",
         ((f) < (((b) < (c) ? (b) : (c))) ? (f) : (((b) < (c) ? (b) : (c)))));
  return 0;
}
