#include <bits/stdc++.h>
using namespace std;
long long INF = 1e9 + 7;
long long MOD = 998244353;
void YESNO(long long a) { cout << (a ? "Yes" : "No") << "\n"; }
int main(void) {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  long long n;
  cin >> n;
  string s;
  cin >> s;
  long long ans[2] = {0};
  for (long long i = 0; i < n; i++) {
    if (s[i] - '0' != i % 2) {
      ans[0]++;
    } else {
      ans[1]++;
    }
  }
  cout << min(ans[0], ans[1]) << "\n";
}
