#include <bits/stdc++.h>
int min(int a, int b) {
  if (a >= b) {
    return b;
  } else {
    return a;
  }
}
int main() {
  char buf[1024];
  char S[200010];
  int N;
  fgets(buf, sizeof(buf), stdin);
  sscanf(buf, "%d", &N);
  fgets(S, sizeof(S), stdin);
  int start = 0;
  int end = N - 1;
  while (S[start] == '.') {
    start++;
  }
  while (S[end] == '#') {
    end--;
  }
  int countw = 0;
  int countb = 0;
  for (int i = start; i < ((int)end + 1); i++) {
    if (S[i] == '.') {
      countw++;
    } else {
      countb++;
    }
  }
  int ans = min(countw, countb);
  printf("%d\n", ans);
  return 0;
}
