#include <bits/stdc++.h>
char s[2000001];
int wn[200001] = {};
int bn[200001] = {};
int main(void) {
  int n, i, white = 0, black = 0, ans = 0;
  scanf("%d", &n);
  scanf("%s", s);
  if (s[0] == '.') {
    white++;
    wn[0] = 1;
  } else {
    black++;
    bn[0] = 1;
  }
  for (i = 1; i < n; i++) {
    if (s[i] == '.') {
      white++;
      wn[i] = wn[i - 1] + 1;
      bn[i] = bn[i - 1];
    } else {
      black++;
      wn[i] = wn[i - 1];
      bn[i] = bn[i - 1] + 1;
    }
  }
  ans = black;
  int temp;
  for (i = 0; i < n; i++) {
    temp = bn[i];
    temp += (white - wn[i]);
    if (ans > temp) ans = temp;
  }
  printf("%d", ans);
}
