#include <bits/stdc++.h>
using namespace std;
int main() {
  string S;
  cin >> S;
  list<int> s;
  list<int>::iterator itr;
  for (int i = 0; i < S.size(); i++) {
    if (s.size() == 0) {
      s.push_back(S[i] == '0');
    } else {
      itr = s.end();
      itr--;
      if (*itr != (S[i] == '0')) {
        s.erase(itr);
      } else {
        s.push_back(S[i] == '0');
      }
    }
  }
  cout << S.size() - s.size() << endl;
}
