#include <bits/stdc++.h>
using namespace std;
void p(deque<int> q) {
  for (int i = 0; i < q.size(); ++i) {
    cout << q[i];
  }
  cout << endl;
}
int main() {
  int n, ans1 = 0, ans2 = 0;
  deque<int> d, w;
  char c;
  bool s = true;
  cin >> n;
  for (int i = 0; i < n; ++i) {
    cin >> c;
    d.push_back(int(c - 48));
  }
  w = d;
  for (int i = 0; i < n; ++i) {
    if ((i + 1) % 2 != d[i]) {
      ans1++;
    }
  }
  for (int i = 0; i < n; ++i) {
    if (i % 2 != d[i]) {
      ans2++;
    }
  }
  ans1 = min(ans1, ans2);
  cout << ans1;
  return 0;
}
