#include <bits/stdc++.h>
int main(void) {
  int n;
  char s[200001];
  int countf, countb;
  int i, flag;
  scanf("%d", &n);
  scanf("%s", s);
  flag = 0;
  countf = 0;
  for (i = 0; i < n; i++) {
    if (!flag) {
      if (s[i] == '#') {
        flag = 1;
      }
    } else {
      if (s[i] == '.') {
        countf++;
      }
    }
  }
  flag = 0;
  countb = 0;
  for (i = n - 1; i >= 0; i--) {
    if (!flag) {
      if (s[i] == '.') {
        flag = 1;
      }
    } else {
      if (s[i] == '#') {
        countb++;
      }
    }
  }
  printf("%d\n", (countf > countb ? countb : countf));
}
