#include <bits/stdc++.h>
int main(void) {
  int N;
  scanf("%d", &N);
  char S[N];
  scanf("%s", S);
  int i;
  int existBW = 0;
  for (i = 0; i < N - 1; i++) {
    if (S[i] == '#') {
      if (S[i + 1] == '.') {
        existBW = 1;
      }
    }
  }
  if (existBW == 1) {
    int countB = 0;
    int countW = 0;
    int checkB = 0;
    for (i = 0; i < N; i++) {
      if (S[i] == '#') {
        countB++;
        if (checkB == 0) {
          checkB = i;
        }
      }
      if (S[i] == '.') {
        countW++;
      }
    }
    if (S[0] == '.') {
      countW = countW - checkB;
    }
    if (countB >= countW) {
      printf("%d", countW);
      return 0;
    }
    printf("%d", countB);
    return 0;
  }
  printf("0");
}
