#include <bits/stdc++.h>
using namespace std;
int n;
int f(int x, string s) {
  int ok, i, sum = 0;
  while (true) {
    ok = 1;
    for (i = 1; i < n; i++)
      if (s[i - 1] == s[i]) {
        sum++;
        s[i] = '1';
        s[i - 1] = '0';
        if (i % 2 == x) swap(s[i - 1], s[i]);
        ok = 0;
      }
    if (ok) break;
  }
  return sum;
}
int main() {
  int i;
  string s;
  cin >> n;
  cin >> s;
  i = f(0, s);
  n = f(1, s);
  cout << min(i, n);
  return 0;
}
