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