#include <bits/stdc++.h>
using namespace std;
int solv(string s, bool asd) {
  int i = 1;
  int c = 0;
  if (!asd) {
    c++;
    s[0] = (s[0] == '1' ? '0' : '1');
  }
  char f = s[0];
  for (; i < s.length(); i++) {
    if (s[i] == s[i - 1]) {
      c++;
      s[i] = (s[i] == '1' ? '0' : '1');
    }
  }
  return c;
}
int main() {
  int n;
  cin >> n;
  string s;
  cin >> s;
  n = min(n, solv(s, true));
  n = min(n, solv(s, false));
  cout << n << endl;
  return 0;
}
