#include <bits/stdc++.h>
using namespace std;
const int MAXN = 1005;
char st[MAXN];
int a[MAXN];
int main() {
  int n;
  int ans = INT_MAX;
  int cnt;
  scanf("%d%s", &n, st);
  for (int i = 0; i < n; i++) a[i] = st[i] - '0';
  cnt = 0;
  for (int i = 0; i < n; i++)
    if (a[i] % 2 != i % 2) {
      if (i < n - 1 && a[i + 1] == a[i]) i++;
      cnt++;
    }
  ans = min(ans, cnt);
  cnt = 0;
  for (int i = 0; i < n; i++)
    if (a[i] % 2 != (i + 1) % 2) {
      if (i < n - 1 && a[i + 1] == a[i]) i++;
      cnt++;
    }
  ans = min(ans, cnt);
  printf("%d\n", ans);
  return 0;
}
