#include <bits/stdc++.h>
using namespace std;
int dp[1005][2];
int a[1005];
int main(void) {
  int n;
  scanf("%d", &n);
  for (int(i) = 0; (i) < (n); (i)++) {
    scanf("%1d", &a[i]);
  }
  dp[0][0] = (a[0] == 0 ? 0 : 1);
  dp[0][1] = (a[0] == 1 ? 0 : 1);
  for (int(i) = (1); (i) < (n); (i)++) {
    if (a[i] == 0) {
      dp[i][0] = dp[i - 1][1];
      dp[i][1] = dp[i - 1][0] + 1;
    }
    if (a[i] == 1) {
      dp[i][0] = dp[i - 1][1] + 1;
      dp[i][1] = dp[i - 1][0];
    }
  }
  printf("%d\n", min(dp[n - 1][0], dp[n - 1][1]));
}
