#include <bits/stdc++.h>
using namespace std;
char b[] = {'0', '1'};
char c[] = {'1', '0'};
int main() {
  int N;
  char a;
  while (cin >> N) {
    int r1 = 0, r2 = 0;
    getchar();
    for (int i = 0; i < N; i++) {
      scanf("%c", &a);
      if (a != b[i % 2]) r1++;
      if (a != c[i % 2]) r2++;
    }
    cout << min(r1, r2) << endl;
  }
  return 0;
}
