#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, i, ans1 = 0, ans2 = 0, res, x, y;
  string s;
  cin >> n >> s;
  string s1 = "";
  string s2 = "";
  i = 0;
  while (i < n) {
    s1 += "1";
    i++;
    if (i < n) s1 += "0";
    i++;
  }
  for (long long k = 0; k < n; k++) {
    if (s1[k] == '1')
      s2 += "0";
    else
      s2 += "1";
  }
  for (long long in = 0; in < n; in++) {
    x = s1[in] - '0';
    y = s[in] - '0';
    ans1 += (x ^ y);
  }
  for (long long in = 0; in < n; in++) {
    x = s2[in] - '0';
    y = s[in] - '0';
    ans2 += (x ^ y);
  }
  res = min(ans1, ans2);
  cout << res;
  return 0;
}
