#include <bits/stdc++.h>
const int MAXN = 1000;
char s[2][MAXN];
int main(int argc, char const *argv[]) {
  int n;
  scanf("%d ", &n);
  for (int i = 0; i < n; ++i) {
    s[0][i] = s[1][i] = getchar() - '0';
  }
  int r[2] = {0};
  for (int k = 0; k <= 1; ++k) {
    bool bf = true;
    while (bf) {
      bf = false;
      for (int i = 0; i < n; ++i) {
        char target = (i & 1) ^ k;
        if (s[k][i] != target &&
            (i == n - 1 || i != n - 1 && s[k][i + 1] == s[k][i])) {
          s[k][i] = target;
          ++r[k];
          bf = true;
        }
      }
    }
  }
  printf("%d\n", (r[0] < r[1]) ? (r[0]) : (r[1]));
  return 0;
}
