#include <bits/stdc++.h>
char S[200000];
void Do(int N) {
  int i, n, clb, crb, crw, bbb, wbb, www, m;
  scanf("%s", S);
  clb = crb = crw = 0;
  for (i = 0; i < N; i++) {
    if (S[i] == '.')
      clb++;
    else {
      n = i;
      for (i = n + 1; i < N; i++) {
        if (S[i] == '#')
          crw++;
        else
          crb++;
      }
    }
  }
  bbb = clb + crb;
  wbb = crb;
  www = crw + 1;
  if (bbb > wbb) {
    if (wbb > www)
      m = www;
    else
      m = wbb;
  } else {
    if (bbb > www)
      m = www;
    else
      m = bbb;
  }
  printf("%d\n", m);
}
int main(void) {
  int N;
  scanf("%d", &N);
  Do(N);
  return 0;
}
