#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  string cbs;
  cin >> cbs;
  int ot = 0;
  int tm = 0;
  do {
    for (int i = 0; i < cbs.length(); i++) {
      if (cbs[i] == '1' && cbs[i + 1] == '0') {
        ot++;
        cbs.erase(i + 1);
        cbs.erase(i);
        tm++;
      } else if (cbs[i] == '0' && cbs[i + 1] == '1') {
        ot++;
        cbs.erase(i + 1);
        cbs.erase(i);
        tm++;
      }
    }
  } while (tm != 0);
  cout << ot << endl;
  return 0;
}
