#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int diff(int n, vector<bool>& a, vector<bool>& b) {
  int ans = 0;
  for (int i = 0; i < n; i++) {
    ans += a[i] != b[i];
  }
  return ans;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int n;
  string s;
  cin >> n >> s;
  vector<bool> v;
  for (char c : s) {
    v.push_back(c == '1');
  }
  vector<bool> ans1;
  vector<bool> ans2;
  for (int i = 0; i < n; i++) {
    ans1.push_back(i & 1);
    ans2.push_back(not ans1.back());
  }
  cout << min(diff(n, v, ans1), diff(n, v, ans2)) << '\n';
  return 0;
}
