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