#include <bits/stdc++.h>
int main(int argc, char const *argv[]) {
  int r = 0, b = 0;
  char ch, str[100000];
  scanf("%s", str);
  while ((ch = getchar()) != EOF) {
    if (ch = '0')
      ++r;
    else
      ++b;
  }
  printf("%d\n", (r < b) ? r : b);
  return 0;
}
