#include <bits/stdc++.h>
using namespace std;
const long long mx = 300009;
long long a[mx], b[mx];
int n;
string str;
int main() {
  cin >> n >> str;
  int ans = 0, ans1 = 0;
  for (int i = 0; i < n; i++) {
    int d = str[i] - '0';
    ans += (d != (i & 1));
    ans1 += (d == (i & 1));
  }
  cout << min(ans, ans1) << '\n';
}
