#include <bits/stdc++.h>
int main(void) {
  int n;
  char str[200000];
  int i, j, k;
  int cnt1, cnt2;
  scanf("%d", &n);
  scanf("%s", str);
  cnt1 = cnt2 = 0;
  for (i = 0; i < n; i++) {
    if (str[i] == '#') {
      cnt1++;
    } else {
      cnt2++;
    }
  }
  if (cnt1 < cnt2) {
    printf("%d\n", cnt1);
  } else {
    printf("%d\n", cnt2);
  }
  return 0;
}
