#include <bits/stdc++.h>
using namespace std;
const int INF = 1000 * 1000 * 1000;
const double EPS = 1e-9;
int a[1000 + 1];
int main() {
  int n;
  scanf("%d\n", &n);
  for (int i = 0; i < n; ++i) {
    scanf("%c", &a[i]);
    a[i] -= '0';
  }
  int cnt1 = 0, cnt2 = 0;
  for (int i = 0; i < n; ++i)
    if (a[i] != (i & 1))
      ++cnt1;
    else
      ++cnt2;
  printf("%d", min(cnt1, cnt2));
  return 0;
}
