#include <bits/stdc++.h>
using namespace std;
const double eps = 0.000000000000001;
char str[1010];
int main() {
  int n, i, j;
  int ans[2] = {0};
  scanf("%d", &n);
  scanf("%s", str);
  for (i = 0; i < n; i++) {
    ans[!(i & 1) ^ (str[i] - '0')]++;
  }
  printf("%d\n", min(ans[0], ans[1]));
  return 0;
}
