#include <bits/stdc++.h>
int main(void) {
  int N;
  char S[200000];
  int count = 0;
  int count2 = 0;
  int b, w;
  scanf("%d", &N);
  scanf("%s", S);
  for (int a = 0; a < N; a++) {
    if (S[a] == '.')
      w += 1;
    else if (S[a] == '#')
      b += 1;
  }
  if (S[0] == '#') {
    if (b > w)
      count = w;
    else
      count = b;
    printf("%d\n", count);
  } else {
    if (b > w - 1)
      count2 = w - 1;
    else
      count2 = b;
    if (count2 == 0) count2 = 1;
    printf("%d\n", count2);
  }
  return 0;
}
