#include <bits/stdc++.h>
int main(void) {
  int N;
  char S[2 * 10 * 10 * 10 * 10 * 10];
  int i;
  int B[2 * 10 * 10 * 10 * 10 * 10] = {0};
  int W[2 * 10 * 10 * 10 * 10 * 10] = {0};
  int ans = 2 * 10 * 10 * 10 * 10 * 10;
  int myself = 0;
  scanf("%d %s", &N, S);
  for (i = N - 2; i >= 0; i--) {
    if (S[i + 1] == '#') {
      B[i] = B[i + 1] + 1;
      W[i] = W[i + 1];
    } else {
      W[i] = W[i + 1] + 1;
      B[i] = B[i + 1];
    }
  }
  if (B[0] == 0) {
    printf("0");
    return 0;
  }
  for (i = 0; i < N; i++) {
    if (S[i] == '#') {
      if (ans > W[i] + myself) {
        ans = W[i] + myself;
      }
      myself++;
    }
  }
  printf("%d", ans);
  return 0;
}
