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