#include <bits/stdc++.h>
int count;
char stone[200000];
int main(int argc, char const *argv[]) {
  int start;
  int black = 0, white = 0;
  scanf("%d", &count);
  scanf("%s", stone);
  for (start = 0; start < count && stone[start] == '.'; start++) {
  }
  for (int i = start; i < count; i++) {
    if (stone[i] == '#')
      black++;
    else
      white++;
  }
  printf("%d\n", (white < black) ? white : black);
  return 0;
}
