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