#include <bits/stdc++.h>
int main(void) {
  int N;
  char *S;
  char black = 0;
  int count = 0;
  scanf("%d\n", &N);
  for (int i = 0; i < N; i++) {
    char c;
    char stone;
    scanf("%c", &c);
    if (c == '.')
      stone = 0;
    else
      stone = 1;
    if (stone == 1) black++;
    if (black > 0 && stone == 0) count++;
  }
  if (black < count)
    printf("%d", black);
  else
    printf("%d", count);
  return 0;
}
