#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int n;
  cin >> n;
  string s;
  cin >> s;
  string init = s;
  int ans = 100500;
  for (int st = 0; st < 2; ++st) {
    string goal = "";
    s = init;
    for (int i = 0; i < n; ++i) {
      goal += char((i + st) % 2 + '0');
    }
    int curr = 0;
    for (int i = 0; i < n; ++i) {
      if (s[i] == goal[i]) {
        continue;
      }
      ++curr;
    }
    ans = min(ans, curr);
  }
  cout << ans << "\n";
}
