#include <bits/stdc++.h>
using namespace std;
 
int main(){
  string s;
  int i,count = 0;
  cin >>s;
  s = s + "2";
  for(i=0;i<s.size();i++){
    if(atoi(s[i]) == 2 || atoi(s[i+1]) == 2)break;
    if(atoi(s[i]) == 1 && atoi(s[i+1]) == 0){
      s.erase(i,2);
      i -= 2;
      count += 2;
    }else if(atoi(s[i]) == 0 && atoi(s[i+1]) == 1){
      s.erase(i,2);
      i -= 2;
      count += 2;
    }
  }
  cout << count << endl;
}