#include <bits/stdc++.h>
int A[1001];
int main() {
  int N;
  scanf("%d\n", &N);
  for (int i = 0; i < N; i++) {
    char c;
    scanf("%c", &c);
    if (c == '0')
      A[i] = 0;
    else
      A[i] = 1;
  }
  int ans0 = 0;
  int c = 0;
  for (int i = 0; i < N; i++) {
    if (A[i] != c) ans0++;
    c = c == 0 ? 1 : 0;
  }
  int ans1 = 0;
  c = 1;
  for (int i = 0; i < N; i++) {
    if (A[i] != c) ans1++;
    c = c == 0 ? 1 : 0;
  }
  int ans = ans0 < ans1 ? ans0 : ans1;
  printf("%d", ans);
  return 0;
}
