#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  char c[n];
  cin >> c;
  vector<int> numa, numb;
  int a[n];
  for (int i = 0; i < n; i++) {
    if (c[i] == '0')
      a[i] = 0;
    else
      a[i] = 1;
  }
  for (int i = 0; i < n; i++) {
    if (i % 2 != a[i])
      numa.push_back(i);
    else
      numb.push_back(i);
  }
  int suma = 0, sumb = 0;
  cout << min(numa.size(), numb.size());
}
