#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, i, j, k;
  cin >> n;
  string s;
  vector<long long> arr;
  for (i = 0; i < n; i++) {
    char tem;
    cin >> tem;
    s.push_back(tem);
    arr.push_back(tem - '0');
  }
  long long dp[n][2];
  for (i = 0; i < n; i++) {
    if (i == 0) {
      if (arr[i]) {
        dp[i][1] = 0;
        dp[i][0] = 1;
      } else {
        dp[i][0] = 0;
        dp[i][1] = 1;
      }
    } else {
      if (arr[i]) {
        dp[i][1] = dp[i - 1][0];
        dp[i][0] = dp[i - 1][1] + 1;
      } else {
        dp[i][1] = dp[i - 1][0] + 1;
        dp[i][0] = dp[i - 1][1];
      }
    }
  }
  long long ans = min(dp[n - 1][0], dp[n - 1][1]);
  cout << ans << "\n";
  return 0;
}
