#include <bits/stdc++.h>
int main() {
  int N;
  char s[200001];
  scanf("%d", &N);
  scanf("%s", s);
  int i;
  char check;
  int w = 0, b = 0;
  int pos = 0;
  for (i = 0; i < N; i++) {
    if (s[i] == '.') pos = i;
  }
  for (i = 0; i <= pos; i++) {
    if (s[i] == '#')
      b++;
    else
      w++;
  }
  printf("%d\n", b > w ? w : b);
  return 0;
}
