#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, i, a, b;
  char str[3000];
  string s;
  cin >> n;
  cin >> str;
  s = str;
  a = b = 0;
  for (i = 0; i < n; i++) {
    if ((s[i] - '0') != (i % 2 == 0))
      a++;
    else
      b++;
  }
  cout << min(a, b) << endl;
  return 0;
}
