#include <bits/stdc++.h>
int min(int a, int b) {
  if (a < b)
    return a;
  else
    return b;
}
int main() {
  int n, i, c1 = 0, c2 = 0, cc1 = 0, cc2 = 0;
  char a[1010];
  scanf(" %d", &n);
  scanf(" %s", a);
  for (i = 0; i < n; i++) {
    a[i] = a[i] - '0';
    if (i % 2 == 0) {
      if (a[i] == 0) cc1++;
      if (a[i] == 1) cc2++;
    }
    if (i % 2 == 1) {
      if (a[i] == 0) cc2++;
      if (a[i] == 1) cc1++;
    }
  }
  printf("%d", min(cc1, cc2));
  return 0;
}
