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

int main(void) {
  int N, i, start, end, black, white;
  char *S;
  scanf("%d",&N);
  S = (char*)malloc(sizeof(char)*(N+1));
  assert(S);
  for (start = 0, scanf("%s",S); start < n && S[start] == '.'; start++);
  for (end = n-1; end >= 0 && S[end] == '#'; end--);
  for (i = start, black = 0, white = 0; i <= end; i++) {
    if (S[i] == '.') {
      white += 1;
    } else {
      black += 1;
    }
  }
  if (end < start) {
    putchar('0');
  } else if (black < white) {
    printf("%d",black);
  } else {
    printf("%d",white);
  }
  free(S);
  return 0;
}