#include <bits/stdc++.h>
#pragma GCC optimize("O3")
#pragma GCC optimize("Ofast")
using namespace std;
unsigned long long n;
string second;
unsigned long long solve(unsigned long long x) {
  unsigned long long res = 0;
  for (unsigned long long i = 0; i < second.size(); i++) {
    if ((second[i] - '0') != x) {
      res++;
    }
    x ^= 1;
  }
  return res;
}
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  ;
  cin >> n;
  cin >> second;
  cout << min(solve(0), solve(1)) << '\n';
}
