#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  string s;
  cin >> s;
  vector<int> kuro(s.size(), 0);
  vector<int> shiro(s.size(), 0);
  int tmp_kuro = 0, tmp_shiro = 0;
  for (long long(i) = 0; (i) < (long long)(s.size()); ++(i)) {
    if (s[i] == '.') {
      tmp_shiro++;
    } else {
      tmp_kuro++;
    }
    kuro[i] = tmp_kuro;
    shiro[i] = tmp_shiro;
  }
  int ans = 1e9 + 1, tmp = 0;
  for (long long(i) = 0; (i) < (long long)(s.size() + 1); ++(i)) {
    if (i == 0) {
      tmp = shiro[s.size() - 1];
    } else if (i == s.size()) {
      tmp = kuro[s.size() - 1];
    } else {
      tmp = kuro[i];
      tmp += shiro[s.size() - 1] - shiro[i - 1];
    }
    ans = min(ans, tmp);
  }
  cout << ans << endl;
  return 0;
}
