#include <bits/stdc++.h>
int mod = 1000000007;
using namespace std;
string arr1, arr2;
long long power(long long n, int p) {
  long long res = 1;
  while (p--) {
    res *= n;
    res %= mod;
  }
  return res;
}
int main() {
  int n;
  cin >> n;
  cin >> arr1;
  arr2 = arr1;
  string s1, s2;
  for (int i = 0; i < n; i++) {
    if (i % 2) {
      s2 = s2 + '1';
      s1 = s1 + '0';
    } else {
      s2 = s2 + '0';
      s1 = s1 + '1';
    }
  }
  int c1 = 0, c2 = 0;
  for (int j = 0; j < n; j++) {
    for (int i = 0; i < n; i++) {
      if (s1[i] != arr1[i]) {
        if ((i - 1 >= 0 && arr1[i - 1] == arr1[i] ||
             (i + 1 < n && arr1[i + 1] == arr1[i]))) {
          arr1[i] = s1[i];
          c1++;
        }
      }
      if (s2[i] != arr2[i]) {
        if ((i - 1 >= 0 && arr2[i - 1] == arr2[i] ||
             (i + 1 < n && arr2[i + 1] == arr2[i]))) {
          arr2[i] = s2[i];
          c2++;
        }
      }
    }
  }
  for (int i = 0; i < n; i++) {
    if (s1[i] != arr1[i]) c1 = INT_MAX;
    if (s2[i] != arr2[i]) c2 = INT_MAX;
  }
  cout << min(c1, c2);
}
