#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const char* LF = "\n";
namespace {
struct _ {
  _() {
    cin.tie(0);
    ios::sync_with_stdio(false);
  }
} a;
}  // namespace
signed main() {
  ll N;
  cin >> N;
  string S;
  cin >> S;
  ll nb = 0;
  ll nw = 0;
  for (int i = (0), iLen_ = (N); i < iLen_; i++) {
    if (S[i] == '.') {
      nw++;
    }
  }
  ll ans = 1e7;
  for (int i = (0), iLen_ = (N); i < iLen_; i++) {
    if (S[i] == '.') {
      nw--;
    } else {
      nb++;
    }
    ans = min(ans, nw + nb);
  }
  cout << ans << LF;
  return 0;
}
