#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  string s;
  cin >> s;
  vector<int> vec(n);
  int i;
  for (i = 0; i < n; ++i) {
    vec[i] = ((s[i] == '.') ? 1 : 0);
  }
  for (i = 1; i < n; ++i) {
    vec[i] += vec[i - 1];
  }
  vector<int> changes(n + 1);
  changes[0] = vec[n];
  for (i = 1; i < (n + 1); ++i) {
    changes[i] = (i - vec[i - 1]) + (vec[n - 1] - vec[i - 1]);
  }
  cout << *min_element(changes.begin(), changes.end());
  return 0;
}
