#include <stdio.h>
#include <stdlib.h>

#define BLACK   '#'
#define WHITE   '.'

int main(void){

  int   n, count;
  char  *s;

  scanf("%d", &n);
  s = malloc(n * sizeof(s));
  scanf("%s", s);

  count = 0;
  for (size_t i = 0; i < n - 2; i++) {
    if (( s[i] == BLACK) && ( s[i + 1] == WHITE)) {
      if (s[i + 2] == BLACK) {
        count++;
      }else if (s[i + 2] == WHITE) {
        if (s[i - 1] == WHITE) {
          count++;
        }else{
          count += 2;
        }
      }else{
        count++;
      }
    }
  }

  printf("%d\n", count);

  return 0;

}
