#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int n;
  cin >> n;
  string s;
  cin >> s;
  bool ok = true;
  for (int i = 1; i < n; i++) {
    ok &= (s[i] != s[i - 1]);
  }
  if (ok) {
    cout << "0\n";
    return 0;
  }
  int res = n;
  for (int i = 0; i < 2; i++) {
    int cur = 0;
    for (int j = 0; j < n; j++) {
      char ch = ((j + i) % 2) + '0';
      if (ch != s[j]) {
        ++cur;
      }
    }
    res = min(res, cur);
  }
  cout << res << '\n';
  return 0;
}
