#include <bits/stdc++.h>
using namespace std;
int M[1002][2];
int main() {
  int T, i, j, k;
  cin >> T;
  string s;
  cin >> s;
  M[0][0] = (s[0] != '0');
  M[0][1] = (s[0] != '1');
  for (i = 1; i < T; i++) {
    M[i][0] = M[i - 1][1] + (s[i] != '0');
    M[i][1] = M[i - 1][0] + (s[i] != '1');
  }
  cout << min(M[T - 1][0], M[T - 1][1]) << endl;
}
