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