#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m1 = 0, m2 = 0;
  char a = '0', b = '1';
  scanf("%d", &n);
  string s;
  cin >> s;
  for (int i = (0); i < (n); ++i) {
    if (s[i] != a) m1++;
    if (s[i] != b) m2++;
    swap(a, b);
  }
  printf("%d\n", min(m1, m2));
}
