#include <bits/stdc++.h>
int main() {
  int kuro = 0, siro = 0, nocount = 0, n, i;
  char s[200001];
  scanf("%d", &n);
  scanf("%s", s);
  for (i = n - 1; i >= 0; i--) {
    if (s[i] == '#') nocount++;
    if (s[i] == '.') break;
  }
  n = n - nocount;
  for (i = 0; i < n; i++) {
    if (s[i] == '#') kuro++;
    if (s[i] == '.') siro++;
  }
  if (kuro < siro)
    printf("%d", kuro);
  else
    printf("%d", siro);
  return 0;
}
