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