#include <bits/stdc++.h>
int MIN(int a, int b) { return a < b ? a : b; }
int main() {
  int n, a, b, i, m, k, x, y, c;
  scanf("%d", &n);
  char s[n + 1];
  scanf("%s", s);
  int lr = 0, rl = 0, flag = 0;
  for (i = 0; i < n; i++) {
    if (s[i] == '#') {
      flag = 1;
    }
    if (flag == 1 && s[i] == '#') {
      rl++;
    }
  }
  flag = 0;
  for (i = n - 1; i >= 0; i--) {
    if (s[i] == '.') {
      flag = 1;
    }
    if (flag == 1 && s[i] == '.') {
      lr++;
    }
  }
  printf("%d", MIN(lr, rl));
  return 0;
}
