#include <bits/stdc++.h>
using namespace std;
int n;
char s[1001];
int Gao(bool now) {
  int res = 0;
  for (int i = 0; i < n; i++, now = !now)
    if (s[i] - '0' != now) res++;
  return res;
}
int main() {
  while (scanf("%d", &n) != EOF) {
    scanf("%s", s);
    int res = min(Gao(0), Gao(1));
    if (res == 19921005) res = -1;
    printf("%d\n", res);
  }
  return 0;
}
