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