#include <bits/stdc++.h>
using namespace std;
int c[2][2];
int main() {
  int n;
  cin >> n;
  string s;
  cin >> s;
  for (int i = 0; i < n; i++) c[i % 2][s[i] - '0']++;
  cout << min(c[0][0] + c[1][1], c[0][1] + c[1][0]) << endl;
}
