#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, zero = 0, one = 0;
  string S;
  cin >> n >> S;
  for (int i = 0; i < S.size(); i++) {
    if (i % 2 == 0) {
      if (S[i] != '0')
        zero++;
      else
        one++;
    } else {
      if (S[i] != '1')
        zero++;
      else
        one++;
    }
  }
  cout << min(zero, one) << endl;
  return 0;
}
