#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  string a;
  cin >> a;
  vector<int> b(n + 1);
  vector<int> w(n + 1);
  for (int i = 1; i <= n; i++) {
    if (a[i - 1] == '.') {
      w[i] = w[i - 1] + 1;
      b[i] = b[i - 1];
    } else {
      w[i] = w[i - 1];
      b[i] = b[i - 1] + 1;
    }
  }
  int ans, cnt;
  ans = 200000;
  for (int i = 1; i <= n; i++) {
    cnt = b[i] - w[i] + w[n];
    if (cnt < ans) ans = cnt;
  }
  cout << ans << endl;
}
