#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  cin >> s;
  bool changed = true;
  int orgLen = s.length();
  while (true) {
    if (changed == false || s.length() == 0) break;
    changed = false;
    for (auto itr = s.begin(); itr != (s.end() - 1); itr++) {
      if ((*itr == '0' && *(itr + 1) == '1') ||
          (*itr == '1' && *(itr + 1) == '0')) {
        s.erase(itr, itr + 2);
        changed = true;
        break;
      }
    }
  }
  cout << (orgLen - s.length());
  return 0;
}
