#include <bits/stdc++.h>
int main() {
  int n, a = 0, b = 0, k = -1, j = -1, sum;
  char c[200001];
  scanf("%d", &n);
  scanf("%s", c);
  for (int i = 0; i < n; i++) {
    if (c[i] == '#') {
      k = i;
      break;
    }
  }
  for (int i = n - 1; i >= 0; i--) {
    if (c[i] == '.') {
      j = i;
      break;
    }
  }
  int min = j - k + 1;
  for (int i = k; i <= j; i++) {
    if (c[i] == '.') b++;
  }
  for (int i = k; i <= j; i++) {
    if (c[i] == '#') a++;
    if (c[i] == '.') b++;
    if (i == k)
      sum = b;
    else
      sum = a + b;
    if (min > sum) min = sum;
  }
  printf("%d", sum);
  return 0;
}
