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