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