#include <bits/stdc++.h>
using namespace std;
const int maxn = 1002;
int a[maxn], b[maxn], n, ans;
int work(int k) {
  int s = 0;
  for (int i = 1; i <= n; i++) a[i] = b[i];
  a[0] = k;
  for (int i = 0; i != n; i++)
    if (a[i] == a[i + 1]) {
      a[i + 1] = 1 - a[i];
      s++;
    }
  ans = min(ans, s);
  return 0;
}
void init() {
  cin >> n;
  for (int i = 1; i <= n; i++) {
    char c;
    cin >> c;
    if (c == '1')
      b[i] = 1;
    else
      b[i] = 0;
  }
}
int main() {
  init();
  ans = n + 2;
  work(0);
  work(1);
  cout << ans << endl;
  return 0;
}
