#include <bits/stdc++.h>
using namespace std;
const int MXN = (int)1e5 + 7;
const int MOD = (int)1e9 + 7;
int ans[3], n;
char ch[MXN][3];
bool used[MXN];
char p(char ch) { return (ch == '1' ? '0' : '1'); }
int main() {
  cin >> n;
  for (int i = 1; i <= n; i++) {
    cin >> ch[i][0];
  }
  ch[1][1] = '1';
  ch[1][2] = '0';
  for (int i = 2; i <= n; i++) {
    ch[i][1] = p(ch[i - 1][1]);
    ch[i][2] = p(ch[i - 1][2]);
  }
  for (int i = 1; i <= n; i++) {
    if (ch[i][1] != ch[i][0]) {
      ans[1]++;
    }
    if (ch[i][2] != ch[i][0]) {
      ans[2]++;
    }
  }
  cout << min(ans[1], ans[2]);
  return 0;
}
