#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  int n;
  string s;
  cin >> n >> s;
  int steps0 = 0;
  int steps1 = 0;
  for (int i = 0; i < n; ++i) {
    steps0 += ((s[i] - '0') != (i % 2));
    steps1 += ((s[i] - '0') == (i % 2));
  }
  cout << min(steps0, steps1) << '\n';
  return 0;
}
