#include <bits/stdc++.h>
using namespace std;
int n, ans2, ans1;
string st;
int a[1003], ai, b[1003], s[1003];
void ready() {
  ios::sync_with_stdio(false), cin.tie(0);
  cin >> n;
  cin >> st;
  for (int i = 0; i < n; i++) s[i] = st[i] - '0';
  for (int i = 0; i < n; i += 2) a[i] = 1;
  for (int i = 1; i < n; i += 2) b[i] = 1;
}
int main() {
  ready();
  for (int i = 0; i < n; i++) {
    if (s[i] != a[i]) ans1++;
    if (s[i] != b[i]) ans2++;
  }
  cout << min(ans1, ans2);
  return 0;
}
