#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  string s;
  cin >> n >> s;
  int wcnt = 0, bcnt = 0, ans = INT_MAX;
  vector<pair<int, int>> cnt(n);
  for (auto i = 0; i < n; i++) {
    if (s[i] == '.')
      wcnt++;
    else
      bcnt++;
    cnt[i] = {wcnt, bcnt};
  }
  if (n == wcnt or n == bcnt) {
    cout << 0 << endl;
    return 0;
  }
  for (auto i = 0; i < n; i++)
    ans = min(ans, cnt[i].second + (cnt[n - 1].first - cnt[i].first));
  cout << ans << endl;
  return 0;
}
