#include <bits/stdc++.h>
using namespace std;
ifstream fin("INPUT.txt");
ofstream fout("OUTPUT.txt");
const int N = 102005;
const long M = 10001;
const long long INF = 1000000000000000000;
int mod = 1000000007;
int n, m, k, x, y;
int F(string s) {
  int count = 0;
  for (int i = 1; i < s.size(); i++)
    if (s[i] == s[i - 1]) {
      count++;
      if (s[i] == '0')
        s[i] = '1';
      else
        s[i] = '0';
    }
  return count;
}
int main() {
  ios::sync_with_stdio(false);
  cout.precision(10);
  cin >> n;
  string s;
  cin >> s;
  int Min = F(s);
  s[0] = s[0] == '0' ? '1' : '0';
  Min = min(Min, F(s) + 1);
  cout << Min;
  return 0;
}
