#include <bits/stdc++.h>
using namespace std;
int main() {
  int t, x[1000], c = 0, y[1000], s = 0;
  char arr[1000];
  cin >> t;
  for (int i = 0; i < t; i++) {
    cin >> arr[i];
    arr[i] -= '0';
  }
  if (arr[0] == 0) {
    x[0] = 0;
    y[0] = 1;
    s = 1;
    for (int i = 1; i < t; i++) {
      if (i % 2 == 0) {
        x[i] = 0;
        y[i] = 1;
      } else if (i % 2 == 1) {
        x[i] = 1;
        y[i] = 0;
      }
      if (arr[i] != x[i]) {
        c++;
      }
      if (arr[i] != y[i]) {
        s++;
      }
    }
  } else if (arr[0] == 1) {
    x[0] = 1;
    y[0] = 0;
    s = 1;
    for (int i = 1; i < t; i++) {
      if (i % 2 == 0) {
        x[i] = 1;
        y[i] = 0;
      } else if (i % 2 == 1) {
        x[i] = 0;
        y[i] = 1;
      }
      if (arr[i] != x[i]) {
        c++;
      }
      if (arr[i] != y[i]) {
        s++;
      }
    }
  }
  if (s < c) {
    cout << s;
  } else if (c < s) {
    cout << c;
  } else if (s == c) {
    cout << c;
  }
  return 0;
}
