#include <bits/stdc++.h>
using namespace std;
char cad[1005];
int main() {
  int n;
  scanf("%d", &n);
  scanf("%s", cad);
  string a = string(cad);
  string b = a;
  int len = strlen(cad);
  int menor = 10000;
  int cont = 0;
  for (int i = 0; i < len; i++) {
    if (i % 2 == 0 && cad[i] != '0') {
      cont++;
    }
    if (i % 2 == 1 && cad[i] != '1') {
      cont++;
    }
  }
  menor = min(menor, cont);
  cont = 0;
  for (int i = 0; i < len; i++) {
    if (i % 2 == 0 && cad[i] != '1') {
      cont++;
    }
    if (i % 2 == 1 && cad[i] != '0') {
      cont++;
    }
  }
  menor = min(menor, cont);
  cout << menor << endl;
  return 0;
}
