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