#include <bits/stdc++.h>
using namespace std;
int a[1005];
int main() {
  int n, ans = 0;
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    scanf("%1d", &a[i]);
  }
  for (int i = 1; i <= n; i++) {
    if (a[i] == 0 && i % 2 == 0) {
      ans++;
    }
    if (a[i] == 1 && i % 2 == 1) {
      ans++;
    }
  }
  printf("%d\n", min(ans, n - ans));
  return 0;
}
