#include <bits/stdc++.h>
int min2(int a, int b) { return a > b ? b : a; }
int n, now, min, i;
char s[200001];
int l[200000], r[200000];
int main(void) {
  scanf("%d¥n%s", &n, s);
  l[0] = (s[0] == '#');
  for (i = 1; i < n; i++) {
    l[i] = l[i - 1] + (s[i] == '#');
  }
  r[n - 1] = (s[n - 1] == '.');
  for (i = n - 2; i >= 0; i--) {
    r[i] = r[i + 1] + (s[i] == '.');
  }
  min = n;
  for (i = 0; i < n; i++) {
    now = l[i] + r[i];
    min = min2(min, now);
  }
  printf("%d\n", min);
}
