#include <bits/stdc++.h>
using namespace std;
string str;
int main() {
  ios_base::sync_with_stdio(false);
  int n;
  cin >> n >> str;
  int s1 = 0, s2 = 0;
  for (int i = 0; i < str.size(); i++) {
    if (i % 2 != str[i] - '0') s1++;
    if ((i + 1) % 2 != str[i] - '0') s2++;
  }
  cout << min(s1, s2) << endl;
  return 0;
}
