#include <bits/stdc++.h>
using namespace std;
int w[200010], b[200010];
int main() {
  int n, i, ans = 1000000;
  string s;
  cin >> n >> s;
  for (i = 0; i < n; i++) {
    if (s[i] == '.') {
      w[i + 1] = w[i] + 1;
      b[i + 1] = b[i];
    } else {
      w[i + 1] = w[i];
      b[i + 1] = b[i] + 1;
    }
  }
  for (i = 1; i <= n; i++) ans = min(ans, b[i] + w[n] - w[i]);
  cout << ans;
  return 0;
}
