#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  cin >> N;
  string ss;
  vector<int> vec(N);
  cin >> ss;
  for (int i = 0; i < (int)(N); i++) {
    if (i == 0) {
      if (ss[i] == '.')
        vec[i] = 1;
      else
        vec[i] = 0;
    } else {
      if (ss[i] == '.')
        vec[i] = vec[i - 1] + 1;
      else
        vec[i] = vec[i - 1];
    }
  }
  int min_tmp = N;
  int tmp;
  for (int i = 0; i < (int)(N); i++) {
    if (ss[i] == '.') {
      tmp = i - (vec[i] - 1) + (vec[N - 1] - vec[i]);
      min_tmp = min(min_tmp, tmp);
    }
  }
  cout << min_tmp << endl;
  return 0;
}
