#include <bits/stdc++.h>
using namespace std;
signed main() {
  int N;
  string S;
  cin >> N;
  cin >> S;
  vector<int> white(N), black(N);
  for (int i = 0; i < N; i++) {
    if (S[i] == '.') {
      white[i] = 1;
      black[i] = 0;
    } else {
      white[i] = 0;
      black[i] = 1;
    }
  }
  for (int i = 1; i < N; i++) {
    black[i] += black[i - 1];
  }
  for (int i = N - 2; i >= 0; --i) {
    white[i] += white[i + 1];
  }
  if (black[N - 1] == 0 || white[0] == 0) {
    cout << 0 << endl;
    return 0;
  }
  int ans = N;
  for (int i = 0; i < N - 1; i++) {
    ans = min(white[i + 1] + black[i], ans);
  }
  cout << ans << endl;
  return 0;
}
