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