#include <bits/stdc++.h>
int main(void) {
  int N;
  char S[200000];
  scanf("%d%s", &N, S);
  int cnt_0 = 0, cnt_1 = 0;
  for (int i = 0; i < N; i++) {
    if (S[i] == '#')
      cnt_0++;
    else if (S[i] == '.')
      cnt_1++;
  }
  printf("%d\n", cnt_0 > cnt_1 ? cnt_1 : cnt_0);
  return 0;
}
