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