#include <bits/stdc++.h>
using namespace std;
int A[1001];
int c[1001];
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 0; i < n; i++) scanf("%1d", &A[i]);
  memset(c, 0, sizeof(c));
  for (int i = 0; i < n; i++) {
    if (A[i] == i % 2) c[i] = 1;
  }
  int ans = 0;
  for (int i = 0; i < n; i++) {
    if (c[i] == 1) ans++;
    if (c[i] == 1 && c[i + 1] == 1 && A[i] == A[i + 1]) i++;
  }
  memset(c, 0, sizeof(c));
  for (int i = 0; i < n; i++) {
    if (A[i] != i % 2) c[i] = 1;
  }
  int ans2 = 0;
  for (int i = 0; i < n; i++) {
    if (c[i] == 1) ans2++;
    if (c[i] == 1 && c[i + 1] == 1 && A[i] == A[i + 1]) i++;
  }
  cout << min(ans2, ans) << endl;
}
