#include <bits/stdc++.h>
int main() {
  long long N;
  scanf("%lld", &N);
  char S[N];
  scanf("%s", S);
  long long bcount = 0;
  long long wcount = 0;
  if ((S[1] != '#') && (S[1] != '.')) {
    printf("%lld\n", bcount);
    return 0;
  }
  for (int m = 0; m < N - 1; m++) {
    if (S[m] == '#') {
      wcount++;
    }
  }
  for (int i = 0; i < N - 1; i++) {
    if (S[i] == '#') {
      if (S[i + 1] == '.') {
        bcount++;
        S[i + 1] = '#';
      }
    }
  }
  if (wcount < bcount) {
    printf("%lld\n", wcount);
  } else {
    printf("%lld\n", bcount);
  }
}
