#include <stdio.h>
#include <stdlib.h>
#include <assert.h>
 
int main(void) {
  int N, start, end, initial_black, initial_white, 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--);
  if (end < start) {
    putchar('0');
    free(S);
    return 0;
  }
  for (initial_black = 0; S[start] == '#'; start++, initial_black++);
  for (initial_white = 0; S[start] == '.'; start++, initial_white++);
  for (black = 0, white = 0; start <= end; start++) {
    if (S[i] == '.') {
      white += 1;
    } else {
      black += 1;
    }
  }
  if (initial_black+white < initial_white+white && initial_black+white < initial_black+black) {
    printf("%d",initial_black+white);
  } else if (initial_black+black < initial_white+white && initial_black+black < initial_black+white) {
    printf("%d",initial_black+black);
  } else {
    printf("%d",initial_white+white);
  }
  free(S);
  return 0;
}