#include <bits/stdc++.h>
using namespace std;
int n;
char s[1001];
int dp[1001];
int checkSum(bool type) {
  int sum = 0;
  char ar[] = "01";
  for (int i = 0; i < n; i++) {
    if (s[i] != ar[(int)type]) sum++;
    type = !type;
  }
  return sum;
}
int getNum() {
  int zero = checkSum(0), one = checkSum(1), type = zero > one ? 0 : 1;
  if (type)
    return zero;
  else
    return one;
}
int main() {
  scanf("%d", &n);
  scanf("%s", s);
  cout << getNum();
  return 0;
}
