#include <bits/stdc++.h>
int main(void) {
  int n;
  scanf("%d", &n);
  char s[n + 1];
  scanf("%s", s);
  int lw = 0, rb = 0;
  for (int i = 0; s[i] == '.'; i++) {
    lw++;
  }
  for (int i = n - 1; s[i] == '#'; i--) {
    rb++;
  }
  int w = 0, b = 0;
  for (int i = lw; i < (n - rb); i++) {
    if (s[i] == '.') {
      w++;
    } else {
      b++;
    }
  }
  if (w < b) {
    printf("%d", w);
  } else {
    printf("%d", b);
  }
  return 0;
}
