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