#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 - 2; a++) {
    if (stone[a] == '#') {
      if (stone[a + 1] == '#') {
        if (stone[a + 2] == '.') {
          stone[a + 2] = '#';
          result++;
        }
      } else if (stone[a + 1] == '.') {
        if (stone[a + 2] == '#') {
          stone[a + 1] = '#';
          result++;
        } else if (stone[a + 2] == '.') {
          stone[a] = '.';
          result++;
        }
      }
    }
  }
  printf("%d", result);
  return 0;
}
