#include <bits/stdc++.h>
using namespace std;
long long n;
string s;
long long cal(long long k) {
  long long cnt = 0;
  for (long long i = 0; i < n; i++) {
    if (s[i] - '0' != k) cnt++;
    k = k ^ 1;
  }
  return cnt;
}
signed main() {
  cin >> n;
  cin >> s;
  cout << min(cal(0), cal(1));
}
