#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  string s;
  cin >> s;
  int x = 0, y = 0;
  for (int i = 0; i < n; i++) {
    if (i & 1) {
      if (s[i] == '1') {
        y++;
      } else {
        x++;
      }
    } else {
      if (s[i] == '1') {
        x++;
      } else {
        y++;
      }
    }
  }
  cout << min(x, y);
  return 0;
}
