#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  string s;
  cin >> n >> s;
  vector<int> cnt_vcb(n);
  vector<int> cnt_vcw(n);
  int cnt_b = 0, cnt_w = 0;
  long mini = 200000;
  for (int i = 0; i < n; i++) {
    if (s[i] == '.')
      cnt_w++;
    else
      cnt_b++;
    cnt_vcw[i] = cnt_w;
    cnt_vcb[i] = cnt_b;
  }
  for (int i = 0; i < n; i++) {
    long change = cnt_vcb[i] + cnt_vcw[n - 1] - cnt_vcw[i];
    mini = min(mini, change);
  }
  cout << mini << endl;
}
