#include <bits/stdc++.h>
const int INF = 1e9;
const int MOD = 1e9 + 7;
const long long LINF = 1e18;
using namespace std;
int main(int argc, char const* argv[]) {
  int n;
  string s;
  cin >> n >> s;
  vector<int> b(n + 1);
  vector<int> w(n + 1);
  b[0] = 0;
  w[0] = 0;
  for (int i = 0; i < n; ++i) {
    if (s[i] == '.') {
      w[i + 1] = w[i] + 1;
      b[i + 1] = b[i];
    } else {
      b[i + 1] = b[i] + 1;
      w[i + 1] = w[i];
    }
  }
  long long tmp = 0;
  long long ans = INF;
  for (int i = 0; i < (n); ++i) {
    tmp = b[i] + w[n] - w[i];
    ans = min(ans, tmp);
  }
  cout << ans << endl;
  return 0;
}
