#include <bits/stdc++.h>
using namespace std;
int mas[1001];
char s[1001];
int d[1001][2];
int main() {
  int n;
  char a;
  cin >> n;
  gets(s);
  gets(s);
  for (int i = 0; i < n; i++) {
    if (s[i] == '0')
      mas[i + 1] = 0;
    else
      mas[i + 1] = 1;
  }
  for (int i = 1; i <= n; i++)
    for (int j = 0; j < 2; j++) {
      if (mas[i] == j)
        d[i][j] = d[i - 1][(j + 1) % 2];
      else
        d[i][j] = d[i - 1][(j + 1) % 2] + 1;
    }
  if (d[n][0] < d[n][1])
    cout << d[n][0];
  else
    cout << d[n][1];
  return 0;
}
