#include <bits/stdc++.h>
int main() {
  int n, black = 0, white = 0;
  int i, start = -1;
  char stones[200001];
  scanf("%d", &n);
  scanf("%s", stones);
  for (i = 0; stones[i] != '\0'; i++) {
    if (stones[i] == '#') {
      start = i;
      break;
    }
  }
  for (i = start; stones[i] != '\0'; i++) {
    if (stones[i] == '.')
      white++;
    else
      black++;
  }
  if (start == -1)
    printf("0");
  else if (white >= black)
    printf("%d", n - white);
  else if (white < black)
    printf("%d", n - black);
  return 0;
}
