#include <bits/stdc++.h>
int main(void) {
  int N;
  scanf("%d", &N);
  char S[N + 1];
  scanf("%s", S);
  int max = strlen(S);
  int ans = max;
  int idx = 1;
  int left = 0;
  int right = 0;
  int i;
  int flag = 1;
  for (i = 0; i < N - 1; i++) {
    if (S[i] != S[i + 1]) {
      flag = 0;
      break;
    }
  }
  int lc[N];
  lc[0] = 0;
  for (idx = 0; idx < N - 1; idx++) {
    if (S[idx] == '#') {
      lc[idx + 1] = lc[idx] + 1;
    }
  }
  int rc[N];
  rc[N - 1] = 0;
  for (idx = N - 1; idx > 0; idx--) {
    if (S[idx] == '.') {
      rc[idx - 1] = rc[idx] + 1;
    }
  }
  for (i = 0; i < N - 1; i++) {
    if (ans > lc[i] + rc[i]) {
      ans = lc[i] + rc[i];
    }
  }
  if (flag == 1) {
    printf("0\n");
  } else {
    printf("%d\n", ans);
  }
  return 0;
}
