#include <bits/stdc++.h>
const int MAX_L = 2005;
const int INF_INT = 999999999;
const long long INF_LL = 0x7fffffff;
const int MOD = 1e9 + 7;
const double eps = 1e-9;
const double pi = acos(-1);
using namespace std;
int gao(string &s, string &tmp) {
  int ret = 0;
  for (int i = 0; s[i]; i++) {
    if (s[i] != tmp[i]) ret++;
  }
  return ret;
}
int main() {
  int n;
  string s;
  while (cin >> n) {
    cin >> s;
    int flag = 0;
    string tmp1, tmp2;
    for (int i = 0; s[i]; i++) {
      tmp1 += flag + '0';
      flag ^= 1;
    }
    flag = 1;
    for (int i = 0; s[i]; i++) {
      tmp2 += flag + '0';
      flag ^= 1;
    }
    int ans = INF_INT;
    ans = min(ans, gao(s, tmp1));
    ans = min(ans, gao(s, tmp2));
    cout << ans << endl;
  }
  return 0;
}
