#include <bits/stdc++.h>
int main(void) {
  int N;
  char S[200001];
  scanf("%d", &N);
  scanf("%s", S);
  int i;
  int bcount = 0;
  int wcount = 0;
  for (i = 0; i < N; ++i) {
    if (S[i] == '#') {
      ++bcount;
    }
    if (bcount > 0) {
      if (S[i] == '.') {
        ++wcount;
      }
    }
  }
  printf("%d\n", wcount);
}
