#include <bits/stdc++.h>
int arr[1024];
int narr;
int func(int x) {
  int i, count = 0;
  for (i = 0; i < narr; i++) {
    ("ele = %d : %d\n", i, arr[i]);
    if ((i % 2) == 0) {
      if (arr[i] != x) {
        count++;
      }
    } else {
      if (arr[i] != (!x)) {
        ("%d : %d : ( !x not matched = %d ) \n", i, arr[i], !x);
        count++;
      }
    }
  }
  return count;
}
int main() {
  int t, i;
  int v1, v2;
  scanf("%d\n", &narr);
  for (i = 0; i < narr; i++) {
    t = getchar();
    arr[i] = t - '0';
  }
  v1 = func(1);
  v2 = func(0);
  ("1 at even pos = %d\n", func(1));
  ("1 at odd  pos = %d\n", func(0));
  printf("%d\n", (v1 > v2) ? v2 : v1);
}
