#include <bits/stdc++.h>
using namespace std;
int main() {
  string pattern1;
  string pattern2;
  string board;
  int n;
  cin >> n >> board;
  if (board.size() == 1) {
  }
  for (int i = 0; i < n; ++i) {
    if (i % 2 == 0)
      pattern1 += "0";
    else
      pattern1 += "1";
  }
  for (int i = 0; i < n; ++i) {
    if (i % 2 == 0)
      pattern2 += "1";
    else
      pattern2 += "0";
  }
  int count1 = 0, count2 = 0;
  for (int i = 0; i < pattern1.size(); ++i) {
    if (pattern1[i] != board[i]) {
      count1++;
    }
    if (pattern2[i] != board[i]) {
      count2++;
    }
  }
  if (count1 < count2) {
    cout << count1 << endl;
  } else {
    cout << count2 << endl;
  }
  return 0;
}
