#include <bits/stdc++.h>
int main(void) {
  int N;
  scanf("%d", &N);
  char S[N];
  scanf("%s", S);
  int i;
  int countB = 0;
  int countW = 0;
  for (i = 0; i < N; i++) {
    if (S[i] == '#') {
      countB++;
    }
    if (S[i] == '.') {
      countW++;
    }
  }
  int count = 0;
  if (countB >= countW) {
    printf("%d", countW);
    return 0;
  }
  printf("%d", countB);
  return 0;
}
