#include <bits/stdc++.h>
using namespace std;
void oku() {
  int n;
  cin >> n;
  string s;
  cin >> s;
  string s1, s2;
  for (int i = 0; i < n; i++) {
    s1 += '0' + i % 2;
    s2 += '0' + (i + 1) % 2;
  }
  int cnt1 = 0, cnt2 = 0;
  for (int i = 0; i < n; i++) {
    if (s1[i] != s[i]) cnt1++;
    if (s2[i] != s[i]) cnt2++;
  }
  cout << min(cnt1, cnt2);
}
int main() {
  oku();
  return 0;
}
