#include <bits/stdc++.h>
using namespace std;
int n;
char ch[1101];
int ans1, ans2;
int main() {
  scanf("%d%s", &n, ch);
  for (int i = 0; i < n; i++) {
    if (i & 1) {
      if (ch[i] == '0')
        ans1++;
      else
        ans2++;
    } else {
      if (ch[i] == '0')
        ans2++;
      else
        ans1++;
    }
  }
  return !printf("%d\n", min(ans1, ans2));
}
