#include <bits/stdc++.h>
using namespace std;
const int MaxN = 1000;
int a[MaxN + 5];
int n;
int main() {
  while (~scanf("%d", &n)) {
    int x = 0, y = 0;
    for (int i = 1; i <= n; i++) scanf("%1d", &a[i]);
    int p = 1;
    for (int i = 1; i <= n; i++) {
      if (a[i] != p) x++;
      p = !p;
    }
    p = 0;
    for (int i = 1; i <= n; i++) {
      if (a[i] != p) y++;
      p = !p;
    }
    printf("%d\n", min(x, y));
  }
  return 0;
}
