#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  int n;
  cin >> n;
  string s;
  cin >> s;
  char x[n], y[n];
  for (int i = 0; i < n; ++i) {
    if (i & 1) {
      x[i] = '1';
      y[i] = '0';
    } else {
      x[i] = '0';
      y[i] = '1';
    }
  }
  int c1 = 0, c2 = 0;
  for (int i = 0; i < n; ++i) {
    if (s[i] != x[i])
      c1++;
    else
      c2++;
  }
  cout << min(c1, c2) << "\n";
}
