#include <bits/stdc++.h>
using namespace std;
int n;
string str;
int func(int ch) {
  int ans = 0;
  if (str[0] != ch + '0') ans++;
  ch ^= 1;
  for (int i = 1; i < str.length(); i++) {
    if (str[i] != ch + '0') {
      ans++;
    }
    ch ^= 1;
  }
  return ans;
}
int main() {
  std::ios::sync_with_stdio(false);
  cin >> n;
  cin >> str;
  int ans = 0x3f3f3f3f;
  ans = min(ans, func(0));
  ans = min(ans, func(1));
  cout << ans << endl;
}
