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