#include <bits/stdc++.h>
using namespace std;
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long n;
  cin >> n;
  string s;
  cin >> s;
  string t = s;
  long long ans = 0;
  for (long long j = 0; j < s.length(); j++) {
    for (long long i = 0; i < s.length(); i++) {
      if (((s[i] - '0') != i % 2)) {
        if (i == 0) {
          if (s[i] == s[i + 1]) {
            ans++;
            s[i] = i % 2 + '0';
          }
        } else if (i == (s.length() - 1)) {
          if (s[i] == s[i - 1]) {
            ans++;
            s[i] = i % 2 + '0';
          }
        } else {
          if ((s[i] == s[i + 1]) || (s[i] == s[i - 1])) {
            ans++;
            s[i] = i % 2 + '0';
          }
        }
      }
    }
  }
  long long ans1 = 0;
  s = t;
  for (long long j = 0; j < s.length(); j++) {
    for (long long i = 0; i < s.length(); i++) {
      if (((s[i] - '0') == i % 2)) {
        if (i == 0) {
          if (s[i] == s[i + 1]) {
            ans1++;
            s[i] = '1' - i % 2;
          }
        } else if (i == (s.length() - 1)) {
          if (s[i] == s[i - 1]) {
            ans1++;
            s[i] = '1' - i % 2;
          }
        } else {
          if ((s[i] == s[i + 1]) || (s[i] == s[i - 1])) {
            ans1++;
            s[i] = '1' - i % 2;
          }
        }
      }
    }
  }
  cout << min(ans, ans1) << endl;
  return 0;
}
