#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, i, cnt1, cnt2;
  char str[1005];
  while (scanf("%d", &n) != EOF) {
    scanf("%s", str);
    cnt1 = cnt2 = 0;
    int len = strlen(str);
    for (i = 0; i < len; i++) {
      if (str[i] - '0' != i % 2) cnt1++;
      if (str[i] - '0' != (i + 1) % 2) cnt2++;
    }
    printf("%d\n", min(cnt1, cnt2));
  }
  return 0;
}
