#include <bits/stdc++.h>
const int N = 1000 + 7;
using namespace std;
int n;
string s;
int dp[N];
int solve(int s) {
  int cnt = 0;
  for (int i = 1; i <= n; i++) {
    if (dp[i] != s) cnt++;
    s ^= 1;
  }
  return cnt;
}
int main() {
  ios_base ::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  cin >> n >> s;
  s = '#' + s;
  for (int i = 1; i <= n; i++) {
    dp[i] = s[i] - '0';
  }
  cout << min(solve(1), solve(0));
  exit(0);
}
