#include <bits/stdc++.h>
using namespace std;
enum enum_t { White, Black, Gray };
inline int readInt() {
  char c;
  while (c = getchar(), c != '-' && (c < '0' || c > '9'))
    ;
  bool sign = (c == '-');
  if (sign) c = getchar();
  int n = c - '0';
  while (c = getchar(), c >= '0' && c <= '9') n = 10 * n + c - '0';
  return (!sign) ? n : -n;
}
inline long long readLong() {
  char c;
  while (c = getchar(), c != '-' && (c < '0' || c > '9'))
    ;
  bool sign = (c == '-');
  if (sign) c = getchar();
  long long n = c - '0';
  while (c = getchar(), c >= '0' && c <= '9') n = 10 * n + c - '0';
  return (!sign) ? n : -n;
}
inline void getInt(int &n) {
  char c;
  while (c = getchar(), c != '-' && (c < '0' || c > '9'))
    ;
  bool sign = (c == '-');
  if (sign) c = getchar();
  n = c - '0';
  while (c = getchar(), c >= '0' && c <= '9') n = 10 * n + c - '0';
  if (sign) n = -n;
}
inline void getLong(long long &n) {
  char c;
  while (c = getchar(), c != '-' && (c < '0' || c > '9'))
    ;
  bool sign = (c == '-');
  if (sign) c = getchar();
  n = c - '0';
  while (c = getchar(), c >= '0' && c <= '9') n = 10 * n + c - '0';
  if (sign) n = -n;
}
inline string readString() {
  char c;
  while (c = getchar(), c == ' ' || c == '\n' || c == '\t')
    ;
  string s({c});
  while (c = getchar(), c != EOF && c != ' ' && c != '\n' && c != '\t') s += c;
  return s;
}
char bufWrite[20];
template <typename T>
inline void writeInt(T x) {
  if (x < 0) putchar('-'), x = -x;
  char *bufPos = bufWrite;
  do {
    *bufPos++ = x % 10 + '0';
  } while (x /= 10);
  do {
    putchar(*--bufPos);
  } while (bufPos > bufWrite);
}
template <typename T>
inline void printInt(T x, char c = EOF) {
  if (x < 0) putchar('-'), x = -x;
  char *bufPos = bufWrite;
  do {
    *bufPos++ = x % 10 + '0';
  } while (x /= 10);
  do {
    putchar(*--bufPos);
  } while (bufPos > bufWrite);
  if (c != EOF) putchar(c);
}
template <typename T>
inline T gcd(T a, T b) {
  while (b != 0) swap(b, a %= b);
  return a;
}
template <typename T>
inline T lcm(T a, T b) {
  return a / gcd(a, b) * b;
}
template <typename T>
inline tuple<T, T, T> extgcd(T a, T b) {
  if (!a) return make_tuple(b, 0, 1);
  T g, x, y;
  tie(g, x, y) = extgcd(b % a, a);
  return make_tuple(g, y - (b / a) * x, x);
}
template <typename T>
inline bool bitGet(T x, int bit) {
  return T(1) & (x >> bit);
}
template <typename T>
inline void bitSet(T &x, int bit) {
  x |= (T(1) << bit);
}
template <typename T>
inline void bitReset(T &x, int bit) {
  x &= ~(T(1) << bit);
}
template <typename T>
inline void bitFlip(T &x, int bit) {
  x ^= (T(1) << bit);
}
template <typename T>
inline void bitMake(T &x, int bit, bool v) {
  x ^= (T(1) << bit) & (-v ^ x);
}
const long long LINF = (1LL << 60);
const int INF = (1 << 30);
const int LIM = (1 << 24);
const int MOD = 1e9 + 7;
const int BASE = 1e4;
const int DIGIT = 4;
int query() { return 0; }
int main() {
  int n = readInt();
  string s = readString();
  int odd = 0, eve = 0;
  for (int i = 0; i < n; ++i)
    if (i & 1)
      odd += (s[i] == '1'), eve += (s[i] == '0');
    else
      odd += (s[i] == '0'), eve += (s[i] == '1');
  cout << min(odd, eve);
  return 0;
}
