# include <stdio.h>
# include <stdilb.h>

int main(void){

  int n, count = 0;
  char array[200000];

  scanf("%d%s", &n, array);

  for(int i = 0; i < n; i++){
    if(array[i] == '#'){
      if(array[i + 1] == '.') {
        array[i + 1] = '#';
        count++;
      }
    }
  }

  printf("%d", count);

}