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