#include <bits/stdc++.h>
using namespace std;
int n, f[10000][2];
string s;
int ctn(char s) {
  switch (s) {
    case '1':
      return 1;
    default:
      return 0;
  }
}
int costcal(int pos, int col) {
  if (ctn(s[pos]) != col) {
    return 1;
  } else
    return 0;
}
int main() {
  cin >> n;
  cin >> s;
  f[0][0] = costcal(0, 0);
  f[0][1] = costcal(0, 1);
  for (int i = 1; i < n; i++)
    for (int j = 0; j <= 1; j++) f[i][j] = costcal(i, j) + f[i - 1][abs(j - 1)];
  cout << min(f[n - 1][1], f[n - 1][0]) << endl;
  return 0;
}
