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