#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int i, n, ans = 0, temp = 0;
  cin >> n;
  string s;
  cin >> s;
  for (i = 0; i < n; i++) {
    if (s[i] - '0' != i % 2) ans++;
  }
  for (i = 0; i < n; i++) {
    if (s[i] - '0' == i % 2) temp++;
  }
  cout << min(temp, ans);
}
