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