#include <bits/stdc++.h>
int main() {
  int N, mode[2] = {0}, count[2] = {0};
  char S[200001];
  scanf("%d %s", &N, S);
  for (int i = 0; i < N; i++) {
    if (S[i] == '#') {
      mode[0] = 1;
    } else {
      if (mode[0] = 1) {
        count[0]++;
      }
    }
    if (S[i] == '.') {
      mode[1] = 1;
    } else {
      if (mode[1] = 1) {
        count[1]++;
      }
    }
  }
  if (count[0] > count[1]) {
    printf("%d", count[1]);
  } else {
    printf("%d", count[0]);
  }
}
