#include <bits/stdc++.h>
int main() {
  int n;
  scanf("%d", &n);
  char s[n];
  scanf("%s", s);
  char stone[n][2];
  int i, black = 0, white = 0;
  for (i = 0; i < n; i++) {
    if (s[i] == '#')
      black++;
    else
      white++;
    stone[i][0] = black;
    stone[i][1] = white;
  }
  int min;
  min = (white <= black) ? white : black;
  printf("%d\n", min);
  return 0;
}
