#include <bits/stdc++.h>
using namespace std;
const int inf(1010101010);
int n;
string s, t;
int calc(string s, string t) {
  ::s = s, ::t = t;
  int ans(0);
  deque<int> q;
  for (int i(0); i < (n - 1); i++)
    if (s[i] == s[i + 1]) q.push_back(i);
  while (((int)(q).size())) {
    int i(q.front());
    q.pop_front();
    if (s[i] != s[i + 1]) continue;
    if (s[i] != t[i]) {
      ans++;
      s[i] = t[i];
      if (i - 1 >= 0) q.push_back(i - 1);
    } else {
      ans++;
      s[i + 1] = t[i + 1];
      if (i + 1 < n) q.push_back(i + 1);
    }
  }
  if (s != t) return inf;
  return ans;
}
int main() {
  cin >> n;
  string a;
  cin >> a;
  string s1;
  for (int i(0); i < (n); i++) s1 += ('0' + (i + 0) % 2);
  string s2;
  for (int i(0); i < (n); i++) s2 += ('0' + (i + 1) % 2);
  cout << min(calc(a, s1), calc(a, s2)) << endl;
}
