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