#include <bits/stdc++.h>
int main(void) {
  int n;
  int start;
  int end;
  int ca = 0;
  int cb = 0;
  char order[200100];
  fgets(order, 200100, stdin);
  sscanf(order, "%d", &n);
  fgets(order, 200100, stdin);
  for (int i = 0; i < n; i++) {
    if (order[i] == '#') {
      start = i;
      break;
    }
  }
  for (int i = n - 1; i > 0; i--) {
    if (order[i] == '#') {
      end = i;
      break;
    }
  }
  for (int i = start; i <= end; i++) {
    if (order[i] == '.') {
      ca += 1;
    } else {
      cb += 1;
    }
  }
  if (ca < cb) {
    printf("%d\n", ca);
  } else {
    printf("%d\n", cb);
  }
  return 0;
}
