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