#include <bits/stdc++.h>
int main() {
  int N, m, x = 0;
  scanf("%d", &N);
  char s[N];
  for (m = 0; m <= N; m++) {
    scanf("%c", &s[m]);
    if (s[m - 1] == '#' && s[m] == '.') {
      s[m] = '#';
      x++;
    }
  }
  printf("%d\n", x);
  return 0;
}
