#include <bits/stdc++.h>
using namespace std;
void solve() {
  int n;
  cin >> n;
  string s;
  cin >> s;
  int count1 = 0, count2 = 0;
  for (int i = 0; i < n; i += 2) {
    if (s[i] == s[i + 1])
      count1++;
    else if (s[i] == '0' && s[i + 1] == '1')
      count1 += 2;
    if (s[i] == s[i + 1])
      count2++;
    else if (s[i] == '1' && s[i + 1] == '0')
      count2 += 2;
  }
  if (n % 2 && s[n - 1] == '0') count1++;
  if (n % 2 && s[n - 1] == '1') count2++;
  cout << min(count1, count2) << "\n";
  return;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  solve();
  return 0;
}
