#include <bits/stdc++.h>
int main(int argc, char const *argv[]) {
  int N;
  scanf("%d", &N);
  char S[N];
  scanf("%s", S);
  int B, W;
  int b[N], w[N];
  if (S[0] == '#') {
    b[0] = 1;
  } else {
    b[0] = 0;
  }
  for (size_t i = 1; i < N; i++) {
    if (S[i] == '#') {
      b[i] = b[i - 1] + 1;
      B++;
    } else {
      b[i] = b[i - 1];
      W++;
    }
  }
  for (size_t i = 0; i < N; i++) {
    w[i] = i - b[i];
  }
  int ans = B;
  if (ans > W) {
    ans = W;
  }
  for (size_t i = 0; i < N - 1; i++) {
    if (ans > b[i] + w[N - 1] - w[i]) {
      ans = b[i] + w[N - 1] - w[i];
    }
  }
  printf("%d\n", ans);
  return 0;
}
