#include <bits/stdc++.h>
int main() {
  int N, m, x = 0, t = 0, u = 0;
  scanf("%d", &N);
  char s[N];
  for (m = 0; m <= N; m++) {
    scanf("%c", &s[m]);
  }
  for (m = 0; m <= N; m++) {
    if (s[m] == '.') t++;
  }
  x = t;
  for (m = 0; m <= N; m++) {
    if (s[m] == '.')
      t--;
    else
      u++;
    if (x > (t + u)) x = (t + u);
  }
  printf("%d\n", x);
  return 0;
}
