#include <bits/stdc++.h>
int main(void) {
  int N;
  scanf("%d", &N);
  char s[N + 1];
  scanf("%s", s);
  int countw[N];
  int countb[N];
  int min = N;
  countw[0] = (s[0] == '.');
  countb[0] = (s[0] == '#');
  int count = 0;
  for (int i = 1; i < N; i++) {
    countw[i] = countw[i - 1] + (s[i] == '.');
    countb[i] = countb[i - 1] + (s[i] == '#');
  }
  if ((countb[N - 1] == N) || (countw[N - 1] == N)) {
    min = 0;
  }
  for (int i = 1; i < N; i++) {
    count = countb[i - 1] + (countw[N - 1] - countw[i]);
    if (count < min) {
      min = count;
    }
  }
  printf("%d\n", min);
  return 0;
}
