#include <bits/stdc++.h>
using namespace std;
int n, ar, br, cr;
char ch;
int main() {
  int n;
  cin >> n;
  int ans1 = 0, ans2 = 0;
  for (int i = 1; i <= n; i++) {
    cin >> ch;
    if (ch == '1')
      ar = 1;
    else
      ar = 0;
    if (i % 2 == 1) {
      br = 1;
      cr = 0;
    } else {
      br = 0;
      cr = 1;
    }
    if (ar != br) ans1++;
    if (ar != cr) ans2++;
  }
  cout << min(ans1, ans2);
  return 0;
}
