#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  string s;
  cin >> s;
  vector<int> num_w(n + 1, 0), num_b(n + 1, 0);
  if (s[0] == '.') {
    num_w[0] = 1;
    num_b[0] = 0;
  } else {
    num_w[0] = 0;
    num_b[0] = 1;
  }
  for (int i = 1; i < n; ++i) {
    if (s[i] == '.') {
      num_w[i] = num_w[i - 1] + 1;
      num_b[i] = num_b[i - 1];
    } else {
      num_b[i] = num_b[i - 1] + 1;
      num_w[i] = num_w[i - 1];
    }
  }
  int ans = 1000000000;
  for (int i = 0; i < n; ++i) {
    int cal = 0;
    cal = num_b[i];
    cal += (num_w[n - 1] - num_w[i]);
    ans = min(ans, cal);
  }
  cout << ans << endl;
  return 0;
}
