#include <bits/stdc++.h>
using namespace std;
inline unsigned dist(string s, string p) {
  int ans = 0;
  for (int i = 0; i < s.size(); i++) ans += s[i] != p[i] ? 1 : 0;
  return ans;
}
void solve() {
  int n;
  cin >> n;
  string s;
  cin >> s;
  string patt01, patt10;
  char a = '1', b = '0';
  for (int i = 0; i < n; i++) {
    patt10 += a;
    patt01 += b;
    swap(a, b);
  }
  cout << min(dist(s, patt10), dist(s, patt01)) << endl;
}
int main() {
  solve();
  return 0;
}
