#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  cin >> s;
  sort(s.begin(), s.end());
  cout << min(s.size() - s.find_first_of("1"), s.find_first_of("1")) * 2
       << endl;
}
