#include <bits/stdc++.h>
using namespace std;
void solve() {
  long long N;
  cin >> N;
  string S;
  cin >> S;
  long long cnt = 0, cntsp = 0;
  bool sharp = false;
  for (auto &x : S) {
    if (x == '.') {
      if (sharp) {
        cnt++;
      }
    } else {
      sharp = true;
      cntsp++;
    }
  }
  cout << min(cnt, cntsp) << endl;
}
signed main() {
  cin.tie(nullptr)->sync_with_stdio(false);
  solve();
}
