#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:100000000,100000000")
using namespace std;
const long long inf = 1e18 + 7;
const long long mod = 1e9 + 7;
const long double eps = 1e-10;
const long double PI = 2 * acos(0.0);
const long double E = 2.71828;
const long long seed = 13331;
const long long size = 500005;
int main(void) {
  int n;
  cin >> n;
  string s;
  cin >> s;
  string rez1 = "", rez2 = "";
  for (int i = 0; i < n; i++)
    if (i % 2 == 0)
      rez1 += '0', rez2 += '1';
    else
      rez1 += '1', rez2 += '0';
  int ans1 = 0, ans2 = 0;
  for (int i = 0; i < n; i++) {
    if (s[i] != rez1[i]) ans1++;
    if (s[i] != rez2[i]) ans2++;
  }
  cout << min(ans1, ans2) << endl;
  return 0;
}
