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