#include <bits/stdc++.h>
using namespace std;
double PI = (acos(-1));
long long md = 1000000007;
long long ma = 998244353;
long long pw(long long a, long long b) {
  long long c = 1, m = a;
  while (b) {
    if (b & 1) c = (c * m);
    m = (m * m);
    b /= 2;
  }
  return c;
}
long long pwmd(long long a, long long b) {
  long long c = 1, m = a;
  while (b) {
    if (b & 1) c = ((c * m)) % md;
    m = (m * m) % md;
    b /= 2;
  }
  return c;
}
long long modinv(long long n) { return pwmd(n, md - 2); }
long long min(long long a, long long b) {
  if (a >= b) return b;
  return a;
}
long long nc2(long long n) { return (1ll * n * (n - 1)) / 2; }
long long nsum(long long n) { return (1ll * n * (n + 1)) / 2; }
bool prime(long long a) {
  for (int i = 2; i * i <= a; i++) {
    if (a % i == 0) return false;
  }
  return true;
}
void Sieve(vector<int> &primes) {
  bool IsPrime[100005];
  memset(IsPrime, true, sizeof(IsPrime));
  for (int p = 2; p * p < 100005; p++) {
    if (IsPrime[p] == true) {
      for (int i = p * p; i < 100005; i += p) IsPrime[i] = false;
    }
  }
  for (int p = 2; p < 100005; p++)
    if (IsPrime[p]) primes.push_back(p);
}
vector<char> sml = {'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i',
                    'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r',
                    's', 't', 'u', 'v', 'w', 'x', 'y', 'z'};
vector<char> cap = {'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I',
                    'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R',
                    'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'};
void solve() {
  long long n;
  cin >> n;
  string s;
  cin >> s;
  long long x = 0, y = 0;
  for (int i = 0; i < n; i++) {
    if (i % 2 == 0) {
      if (s[i] == '1')
        x++;
      else
        y++;
    } else {
      if (s[i] == '1')
        y++;
      else
        x++;
    }
  }
  cout << min(x, y) << "\n";
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  ;
  long long tests = 1;
  while (tests--) {
    solve();
  }
  return 0;
}
