#include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
using namespace std;
void solve() {
  int n;
  string s, res1 = "", res2 = "";
  cin >> n >> s;
  for (int i = 0; i < n; i++) {
    if (i % 2 == 0) {
      res1 += '1';
      res2 += '0';
    } else {
      res1 += '0';
      res2 += '1';
    }
  }
  int ans1 = 0, ans2 = 0;
  for (int i = 0; i < n; i++) {
    if (s[i] != res1[i])
      ans1++;
    else
      ans2++;
  }
  cout << min(ans1, ans2) << '\n';
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  solve();
  return 0;
}
