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