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