#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  string s;
  cin >> n >> s;
  int minC = 1000000;
  vector<int> wsum(n + 1, 0);
  vector<int> bsum(n + 1, 0);
  for (int i = 1; i <= n; i++) {
    if (s[i - 1] == '.') {
      wsum[i] = wsum[i - 1] + 1;
      bsum[i] = bsum[i - 1];
    } else {
      wsum[i] = wsum[i - 1];
      bsum[i] = bsum[i - 1] + 1;
    }
  }
  int mn = 1000000;
  for (int i = 1; i <= n; i++) {
    mn = min(mn, bsum[i] + (wsum[n] - wsum[i]));
  }
  cout << mn << endl;
}
