#include <bits/stdc++.h>
using namespace std;
int ara[1003], ara2[1003], n, i, temp, mn, mn2;
int main() {
  char ch;
  while (cin >> n) {
    for (i = 0; i < n; i++) {
      cin >> ch;
      ara[i] = ch - '0';
    }
    mn = 0;
    mn2 = 0;
    temp = 0;
    for (i = 0; i < n; i++) {
      if (ara[i] != i % 2) mn++;
      if (ara[i] != ((i + 1) % 2)) mn2++;
    }
    cout << min(mn, mn2) << endl;
  }
  return 0;
}
