#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  int iLength, iChange;
  register int i;
  bitset<1005> bstCompare;
  string sInput;
  cin >> iLength >> sInput;
  bitset<1005> bstInput(sInput);
  for (i = 1; i <= iLength / 2; ++i) {
    bstCompare.set(2 * i - 1);
  }
  iChange = (bstCompare ^ bstInput).count();
  cout << min(iChange, iLength - iChange);
  return 0;
}
