#include <bits/stdc++.h>
using namespace std;
int main() {
  int N, A = 0, B = 0, C = 0, E = 0, ans, num;
  string S;
  cin >> N;
  cin >> S;
  int D[N], F[N], T[N - 1];
  for (int i = 0; i < N; i++) {
    if (S[i] == '#') {
      C++;
      D[i] = C;
    } else {
      D[i] = C;
    }
  }
  for (int i = (N - 1); i >= 0; --i) {
    if (S[i] == '.') {
      E++;
      F[i] = E;
    } else {
      F[i] = E;
    }
  }
  for (int i = 0; i < N; i++) {
    if (S[i] == '#') A++;
  }
  for (int i = 0; i < N; i++) {
    if (S[i] == '.') B++;
  }
  for (int i = 0; i < N - 1; i++) {
    T[i] = D[i] + F[i + 1];
  }
  sort(T, T + (N - 1));
  num = T[0];
  ans = min(A, B);
  ans = min(ans, num);
  cout << ans << endl;
  return 0;
}
