#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int a = 0;
  for (int i = 0; (i) < (n); ++i) {
    char c;
    cin >> c;
    if ((i + c - '0') % 2 == 0) a++;
  }
  cout << min(a, n - a);
  return 0;
}
