#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  cin >> s >> s;
  int ma = 0, mb = 0;
  for (int i = 0; i < s.size(); i++) {
    if (i % 2 == 0 && s[i] == '1') ma++;
    if (i % 2 == 1 && s[i] == '0') ma++;
  }
  for (int i = 0; i < s.size(); i++) {
    if (i % 2 == 0 && s[i] == '0') mb++;
    if (i % 2 == 1 && s[i] == '1') mb++;
  }
  cout << min(ma, mb) << endl;
}
