#include <bits/stdc++.h>
using namespace std;
const int maxn = 1505;
char a[maxn], b[maxn];
int main() {
  int n, i;
  cin >> n;
  cin >> a;
  int cnt1 = 0, cnt2 = 0;
  for (i = 0; i < n; i++) {
    if (a[i] - '0' != i % 2) cnt1++;
    if (a[i] - '0' == i % 2) cnt2++;
  }
  cout << min(cnt1, cnt2) << endl;
  return 0;
}
