#include <bits/stdc++.h>
using namespace std;
template <class T>
bool INRANGE(T x, T a, T b) {
  return a <= x && x <= b;
}
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  long long N;
  string S;
  cin >> N >> S;
  long long white = 0, black = 0;
  bool first_white = true;
  for (int i = 0; i < (S.length()); ++i) {
    if (S[i] == '.' and first_white) {
      continue;
    } else {
      first_white = false;
      if (S[i] == '.')
        white++;
      else
        black++;
    }
  }
  long long ans = min(white, black);
  cout << ans << endl;
  return 0;
}
