#include <bits/stdc++.h>
using namespace std;
const int mod = 1e9 + 7, A = 2e5 + 5;
int main() {
  ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  int n;
  string s, form1, form2;
  cin >> n >> s;
  form1.resize(n + 1);
  form2.resize(n + 1);
  for (int i = 0; i < n; i++) {
    form1[i] = i % 2 ? '1' : '0';
    form2[i] = i % 2 ? '0' : '1';
  }
  int ans1 = 0, ans2 = 0;
  for (int i = 0; i < n; i++) {
    if (form1[i] != s[i]) ans1++;
    if (form2[i] != s[i]) ans2++;
  }
  cout << min(ans1, ans2);
  return 0;
}
