            #include <iostream>
            using namespace std;
             
            int f(string S){
              static int ans = 0;
              /*static int two = 0;
              static string tmp = S;
         
              yarinaosi:*/
         retry:
              int tmp = ans;
              if(S.length() < 2)return ans;
              
              int tmp = 0;
              for(int i = 0;i < S.length()-tmp;i++){
                if(i != S.length()-1 && S[i] == '0' && S[i + 1] == '1'){
                  //two = 0;
                  ans +=2 ;
                  S.erase(S.begin()+i);
                  S.erase(S.begin()+i+1);
                  tmp += 2;
                  i-=2;
                }
                if(i != S.length()-1 && S[i] == '1' && S[i + 1] == '0'){
                  //two = 0;
                  ans +=2 ;
                  S.erase(S.begin()+i);
                  S.erase(S.begin()+i+1);
                  tmp += 2;
                  i-=2;
                }
              }
              /*two++;
              if(S == tmp)return ans; else goto yarinaosi;
            */
              if(ans != tmp)goto retry;
              return ans;
            }
             
             
            int main(){
              string S;
              cin>>S;    
              cout<<f(S); 
              return 0;
            }