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