#include <bits/stdc++.h>
using namespace std;
int main() {
  char a[1005];
  int n;
  cin >> n;
  cin >> a;
  int x = 0, y = 0;
  for (int i = 0; i < n; i++) {
    if ((a[i] - '0') == i % 2)
      x++;
    else
      y++;
  }
  cout << (x > y ? y : x) << endl;
}
