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