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