#include <bits/stdc++.h>
using namespace std;
const int maxn = 1100;
int n;
char s[maxn + 10];
int data[maxn + 10];
int dp[maxn + 10][2];
int main() {
  cin >> n;
  getchar();
  gets(s);
  int i;
  for (i = 0; s[i]; i++) data[i] = s[i] - '0';
  if (i == 1)
    printf("0\n");
  else {
    int ans1 = 0, ans2 = 0;
    for (int j = 0; j < i; j++) {
      if ((j & 1) != data[j]) ans1++;
    }
    for (int j = 0; j < i; j++) {
      if ((j & 1) == data[j]) ans2++;
    }
    printf("%d\n", min(ans1, ans2));
  }
  return 0;
}
