#include <bits/stdc++.h>
using namespace std;
char str[1001];
int main() {
  int n, ans = 0;
  cin >> n >> str;
  for (int i = 1; i < n; i++)
    if (str[i] == str[i - 1]) {
      str[i] ^= 1;
      ans++;
    }
  cout << min(ans, n - ans);
}
