#include <bits/stdc++.h>
const int LMT = 1002;
using namespace std;
char s[LMT];
int main() {
  int n, a, b;
  a = b = 0;
  scanf("%d", &n);
  scanf("%s", s);
  for (int i = 0; i < n; i++) {
    if ((s[i] + i) & 1)
      a++;
    else
      b++;
  }
  printf("%d\n", min(a, b));
  return 0;
}
