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