#include <bits/stdc++.h>
int main() {
  long int N;
  scanf("%ld", &N);
  char S[N];
  scanf("%s", S);
  long int count = 0;
  if (N == 1) {
    printf("%ld", 0);
  } else {
    for (long int i = 0; i < N - 1; i++) {
      if (S[i] == '#' && S[i + 1] == '.') {
        count++;
      }
    }
    printf("%ld", count);
  }
  return 0;
}
