#include <bits/stdc++.h>
using namespace std;
char s[1010];
int n;
int main() {
  int i, j;
  while (~scanf("%d", &n)) {
    scanf("%s", s);
    int ans1 = 0, ans2 = 0;
    for (i = 0; i < n; i++) {
      if (i & 1) {
        if (s[i] == '0')
          ans1++;
        else
          ans2++;
      } else {
        if (s[i] == '0')
          ans2++;
        else
          ans1++;
      }
    }
    cout << min(ans1, ans2) << endl;
  }
  return 0;
}
