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