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