#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  string S;
  cin >> N >> S;
  vector<int> sdat(N + 2);
  int tmp = 0;
  char c = '.';
  for (int i = 0; i < N; i++) {
    if (S[i] != c) {
      c = S[i];
      tmp++;
    }
    sdat[tmp]++;
  }
  int min = 0;
  for (int i = 0; i < sdat.size(); i += 2) {
    min += sdat[i];
  }
  int last = min;
  int count = 0;
  for (int i = 0; i <= sdat.size(); i += 2) {
    count = last;
    count -= sdat[i];
    count += sdat[i + 1];
    last = count;
    if (min > count) min = count;
  }
  cout << min << endl;
}
