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