#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  string s;
  cin >> s;
  int a[n];
  for (int i = 0; i < n; i++) a[i] = s[i] - 48;
  int c1 = 0;
  for (int i = 0; i < n; i++) {
    if (n % 2 && i == n - 1) {
      if (!a[i]) c1 += 1;
    } else {
      if (a[i] == a[i + 1])
        c1 += 1;
      else if (a[i] == 0 && a[i + 1] == 1)
        c1 += 2;
      i++;
    }
  }
  int c2 = 0;
  for (int i = 0; i < n; i++) {
    if (n % 2 && i == n - 1) {
      if (a[i]) c2 += 1;
    } else {
      if (a[i] == a[i + 1])
        c2 += 1;
      else if (a[i] == 1 && a[i + 1] == 0)
        c2 += 2;
      i++;
    }
  }
  cout << min(c1, c2);
  return 0;
}
