#include <bits/stdc++.h>
using namespace std;
int n, ans1, ans2;
string st;
int main() {
  cin >> n;
  cin >> st;
  for (int i = 0; i < n; i++) {
    if (st[i] == (i + 1) % 2 + '0') {
      ans1++;
    } else {
      ans2++;
    }
  }
  cout << min(ans1, ans2) << endl;
}
