#include <bits/stdc++.h>
using namespace std;
const long long N = 1e3 + 10;
long long dp[N][2];
signed main() {
  long long n;
  cin >> n;
  string s;
  cin >> s;
  if (n == 1) {
    cout << 0 << '\n';
    return 0;
  }
  for (long long i = 1; i <= n; i++) {
    if (s[i - 1] == '0') {
      dp[i][0] = dp[i - 1][1];
      dp[i][1] = dp[i - 1][0] + 1;
    }
    if (s[i - 1] == '1') {
      dp[i][1] = dp[i - 1][0];
      dp[i][0] = dp[i - 1][1] + 1;
    }
  }
  long long ans = min(dp[n][0], dp[n][1]);
  cout << ans << '\n';
}
