#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  string x, y, z;
  int ans = 0;
  scanf("%d", &n);
  cin >> x;
  for (int i = 0; i < n; i++) {
    y += char(i % 2 + 48);
    z += char((1 - i % 2) + 48);
  }
  int cnt1 = 0;
  int cnt2 = 0;
  for (int i = 0; i < n; i++) {
    if (x[i] != y[i]) cnt1++;
    if (x[i] != z[i]) cnt2++;
  }
  printf("%d\n", min(cnt1, cnt2));
  return 0;
}
