#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  long long n, cnt = 0, cnt1 = 0;
  string s;
  cin >> n >> s;
  for (long long i = 0; i < n; i++)
    if (i % 2 == 0) {
      if (s[i] != '0') cnt++;
      if (s[i] != '1') cnt1++;
    } else {
      if (s[i] != '1') cnt++;
      if (s[i] != '0') cnt1++;
    }
  cout << min(cnt, cnt1) << '\n';
  return 0;
}
