#include <bits/stdc++.h>
int cmp(const void *a, const void *b) {
  if ((*(long long *)b - *(long long *)a) > 0) {
    return 1;
  } else if ((*(long long *)b - *(long long *)a) < 0) {
    return -1;
  }
  return 0;
}
int main() {
  int n, i;
  char s[200000];
  scanf("%d", &n);
  scanf("%s", s);
  for (i = 0; s[i] == '.'; i++)
    ;
  int t = i, ans1 = 0, ans2 = 0;
  for (i = t; i < n; i++) {
    if (s[i] == '.') {
      ans1++;
    }
  }
  for (i = n - 1; s[i] == '#'; i--)
    ;
  t = i;
  for (i = t; i >= 0; i--) {
    if (s[i] == '#') {
      ans2++;
    }
  }
  printf("%d", (ans1 < ans2 ? ans1 : ans2));
  return 0;
}
