#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  cin >> s;
  int l = s.length();
  if (s.length() <= 1) return 0;
  int z, count = 0;
  for (int i = 0; i < s.length(); i++) {
    int p = 1;
    int ti = s[i] - '0';
    p ^= ti;
    if (p) z++;
  }
  if (z < l)
    cout << l - z;
  else
    cout << z;
}
