#include<bits/stdc++.h>
using namespace std;
int main(){
  string S;
  cin >> S;
  int R=0,B=0;
  for (int i=0;i<S.length();i++){
    if (S[i]=='0') R++;
    else B++;
  }
  cout << S.length()-(max(R,B)-min(R,B)) << endl;
}
