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