#include <bits/stdc++.h>
int main() {
  long long int i, number, j, k, count_black = 0, count_white = 0, temp, ans;
  scanf("%lld", &number);
  char stone[number + 1];
  fgets(stone, number + 1, stdin);
  for (i = 0; i < number; i++) {
    if (stone[i] == '#') {
      j = i;
      break;
    }
  }
  for (i = number - 1; j <= i; i--) {
    if (stone[i] == '.') {
      k = i;
      break;
    }
  }
  for (i = j; i <= k; i++) {
    if (stone[i] == '.') {
      count_white++;
    } else {
      count_black++;
    }
  }
  ans = (count_white < count_black) ? count_white : count_black;
  printf("%lld\n", ans);
  return 0;
}
