#include <bits/stdc++.h>
using namespace std;
const int OO = (int)1e8;
string s = "1111";
int sz;
int dp(int prev, int cur) {
  if (cur >= sz) return 0;
  if (prev == -1) {
    int a = (s[cur] != '1') + dp(1, cur + 1);
    int b = (s[cur] != '0') + dp(0, cur + 1);
    return min(a, b);
  }
  if (prev != (s[cur] == '1')) return dp(s[cur] == '1', cur + 1);
  return 1 + dp(s[cur] != '1', cur + 1);
}
int main() {
  cin >> sz >> s;
  cout << dp(-1, 0) << endl;
  return 0;
}
