#include <bits/stdc++.h>
using namespace std;
char s[1010];
long long n;
long long dp[1010][3];
long long solve(long long pos, long long prev) {
  if (pos == n) return 0;
  long long &ret = dp[pos][prev];
  if (ret != -1) return ret;
  ret = 1e17;
  if (prev == s[pos] - '0') {
    ret = 1 + solve(pos + 1, prev == 1 ? 0 : 1);
  } else {
    ret = min(ret, solve(pos + 1, s[pos] - '0'));
  }
  return dp[pos][prev] = ret;
}
int main() {
  long long ans;
  scanf("%lld", &n);
  scanf(" %s", &s);
  if (n == 1) {
    cout << 0 << endl;
    return 0;
  }
  memset(dp, -1, sizeof dp);
  if (s[0] == '0') {
    ans = solve(1, 0);
    ans = min(ans, 1 + solve(1, 1));
  } else {
    ans = solve(1, 1);
    ans = min(ans, 1 + solve(1, 0));
  }
  printf("%lld\n", ans);
}
