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