#include <bits/stdc++.h>
using namespace std;
const long long int N = 1e3 + 2;
const long long int INF = 1e9 + 9;
const long long int mod = 1e9 + 7;
void solve() {
  long long int n;
  cin >> n;
  string s;
  cin >> s;
  long long int i, dp[n + 1][2], ans = 0;
  dp[0][0] = 0, dp[0][1] = 0;
  for (i = 1; i <= n; i++) {
    if (s[i - 1] == '1') {
      dp[i][0] = dp[i - 1][1] + 1;
      dp[i][1] = dp[i - 1][0];
    } else {
      dp[i][1] = dp[i - 1][0] + 1;
      dp[i][0] = dp[i - 1][1];
    }
  }
  ans = min(dp[n][0], dp[n][1]);
  cout << ans << '\n';
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  ;
  long long int t = 1;
  for (long long int i = 1; i <= t; i++) {
    solve();
  }
}
