#include <bits/stdc++.h>
using namespace std;
using namespace std;
int main() {
  long long n;
  cin >> n;
  string s;
  cin >> s;
  bool siro = false;
  long long b = 0, w = 0;
  for (long long i = 0; i < (n); i++) {
    if (s[i] == '.') {
      if (siro) w++;
    } else {
      if (!siro) siro = true;
      b++;
    }
  }
  cout << min(b, w) << endl;
}
