#include <bits/stdc++.h>
using namespace std;
bool solve() {
  long long n;
  cin >> n;
  if (not cin) {
    return false;
  }
  string s;
  cin >> s;
  long long a = 0;
  long long b = 0;
  for (long long i = 0; i < s.size(); i++) {
    auto d = s[i] - '0';
    if (d != i % 2) {
      a++;
    }
    if (d != ((i + 1) % 2)) {
      b++;
    }
  }
  cout << min(a, b) << "\n";
  return true;
}
int main() {
  while (cin) {
    auto suc = solve();
    if (suc == false) {
      break;
    }
  }
}
