#include <bits/stdc++.h>
using namespace std;
long long gcd(long long a, long long b) {
  if (!b) return a;
  return gcd(b, a % b);
}
signed main() {
  long long n, cnt_b = 0, cnt_w = 0, index = 0;
  string s;
  cin >> n >> s;
  for (int i = 0; i < s.size(); i++) {
    if (s[i] == '.') index = i;
  }
  for (int i = 0; i < s.size(); i++) {
    if (i <= index) {
      if (s[i] == '.')
        cnt_w++;
      else
        cnt_b++;
    }
  }
  cout << min(cnt_w, cnt_b) << endl;
  return 0;
}
