#include <bits/stdc++.h>
int main(void) {
  int n, i, b_count = 0, w_count = 0;
  char s[210000];
  scanf("%d%s", &n, s);
  for (i = 0; i < n; i++) {
    if (s[i] == '#')
      b_count++;
    else
      w_count++;
  }
  if (b_count == 0 || w_count == 0)
    printf("0\n");
  else if (b_count >= w_count)
    printf("%d\n", w_count);
  else
    printf("%d\n", b_count);
  return 0;
}
