#include <bits/stdc++.h>
using namespace std;
string s, s1, s2;
int len;
int work1() {
  if (len == 1) return 0;
  int ret = 0;
  s1 = s;
  for (int i = 0; i < len; i++) {
    if (s1[i] - '0' == i % 2) ret++;
  }
  if (ret == len)
    return -1;
  else
    return ret;
}
int work2() {
  if (len == 1) return 0;
  int ret = 0;
  s1 = s;
  for (int i = 0; i < len; i++) {
    if (s1[i] - '0' != i % 2) {
      ret++;
    }
  }
  if (ret == len)
    return -1;
  else
    return ret;
}
int main() {
  cin >> len;
  cin >> s;
  len = s.size();
  int ans1, ans2, ans;
  ans1 = work1();
  ans2 = work2();
  if (ans1 == -1 || ans2 == -1)
    ans = max(ans1, ans2);
  else
    ans = min(ans1, ans2);
  cout << ans << endl;
  return 0;
}
