#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n;
  cin >> n;
  string s;
  cin >> s;
  long long po[200100] = {0}, sh[200100] = {0};
  long long ponum = 0, shnum = 0;
  for (int i = 0; i < n; ++i) {
    if (s[i] == '.') {
      ponum++;
    } else {
      shnum++;
    }
    po[i] = ponum;
    sh[i] = shnum;
  }
  long long res = 0, ans = 1e9;
  for (int i = 0; i < n; ++i) {
    res = sh[i] + (po[n - 1] - po[i]);
    ans = min(ans, res);
  }
  cout << ans << endl;
}
