#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  string w;
  cin >> n >> w;
  int c1 = 0, c2 = 0;
  for (int color1 = 0, color2 = 1, i = 0; i < n;
       i++, color1 ^= 1, color2 ^= 1) {
    c1 += ((w[i] - '0') != color1);
    c2 += ((w[i] - '0') != color2);
  }
  cout << min(c1, c2) << '\n';
  return 0;
}
