#include <stdlib.h>
#include <bits/stdc++.h>
#include <math.h>
using namespace std;
using ll=long long;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
inline constexpr ll gcd(ll a,ll b){if(!a||!b)return 0;while(b){ll c=b;b=a%b;a=c;}return a;}
inline constexpr ll lcm(ll a,ll b){if(!a||!b)return 0;return a*b/gcd(a,b);}

int main() {
   string a;
   cin>>a;
   int count=0;
   if(a.size()==1){
      cout<<0<<endl;
   }
   else{
      int i=0;
      while(i<a.size()-1){  
         if((a.at(i)=='1'&&a.at(i+1)=='0')||(a.at(i)=='0'&&a.at(i+1)=='1')){
            a=a.erase(i,2);
            count+=2;
            i=0;
            if(a==""){
               break;
            }
         }
         else{
            i++;
         }
      }
      cout<<count<<endl;
   }
}

