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