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