#include <bits/stdc++.h>
int main() {
  char s[200000];
  int n, cnt, i;
  cnt = 0;
  scanf("%d", &n);
  scanf("%s", s);
  while (s[n - 1] == '#') n--;
  for (i = 0; i < n; i++) {
    if (s[i] == '.') cnt++;
  }
  if (cnt > n / 2) cnt = n - cnt;
  printf("%d", cnt);
  return 0;
}
