#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  char input[n];
  cin >> input;
  int a = 0, b = 0;
  for (int i = 0; i < n; ++i) {
    if (i % 2 == input[i] - '0') {
      a++;
    } else {
      b++;
    }
  }
  cout << min(a, b) << endl;
}
