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