#include <bits/stdc++.h>
using namespace std;
const int MAX = 2e5 + 7;
int dp[2][MAX], n;
string s;
int func() {
  s = "#" + s;
  for (int i = 1; i <= n; i++)
    if (s[i] == '0') {
      dp[0][i] = dp[1][i - 1];
      dp[1][i] = 1 + dp[0][i - 1];
    } else if (s[i] == '1') {
      dp[1][i] = dp[0][i - 1];
      dp[0][i] = 1 + dp[1][i - 1];
    }
  return min(dp[0][n], dp[1][n]);
}
int main() {
  ios_base::sync_with_stdio(false);
  cin >> n >> s;
  cout << func() << endl;
}
