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