#include <bits/stdc++.h>
int main() {
  int N;
  scanf("%d", &N);
  char S[N + 1];
  scanf("%s", S);
  int cnt = 0, wtmp = 0, btmp = 0, flag = 0;
  int wnum[N], bnum[N];
  for (int i = 0; i < N; i++) {
    if (S[i] == '.') {
      flag = 1;
      wtmp++;
    } else {
      if (flag == 1) {
        wnum[cnt] = wtmp;
        bnum[cnt] = btmp;
        wtmp = 0;
        btmp = 0;
        cnt++;
        flag = 0;
      }
      btmp++;
    }
  }
  wnum[cnt] = wtmp;
  bnum[cnt] = btmp;
  int min, tmp = 0;
  int j;
  for (j = 0; j < cnt + 1; j++) {
    tmp += wnum[j];
  }
  min = tmp;
  for (int i = 1; i < cnt + 1; i++) {
    tmp = 0;
    for (j = 0; j < i; j++) {
      tmp += bnum[j];
    }
    for (j = i; j < cnt + 1; j++) {
      tmp += wnum[j];
    }
    if (tmp < min) {
      min = tmp;
    }
  }
  tmp = 0;
  for (j = 0; j < cnt + 1; j++) {
    tmp += bnum[j];
  }
  if (tmp < min) {
    min = tmp;
  }
  printf("%d", min);
  return 0;
}
