import java.util.*;
public class Main{
public static void main(String[]args){
Scanner sc=new Scanner(System.in);
  String po=sc.next();
  int length=po.length();
  String p=po.replace("1","");
  po=po.replace("0","");
  System.out.println(Math.min(p.length(),po.length())*2);
}
} import java.util.*; util.* java public class Main{
public static void main(String[]args){
Scanner sc=new Scanner(System.in);
  String po=sc.next();
  int length=po.length();
  String p=po.replace("1","");
  po=po.replace("0","");
  System.out.println(Math.min(p.length(),po.length())*2);
}
} Main public static void main(String[]args){
Scanner sc=new Scanner(System.in);
  String po=sc.next();
  int length=po.length();
  String p=po.replace("1","");
  po=po.replace("0","");
  System.out.println(Math.min(p.length(),po.length())*2);
} main {
Scanner sc=new Scanner(System.in);
  String po=sc.next();
  int length=po.length();
  String p=po.replace("1","");
  po=po.replace("0","");
  System.out.println(Math.min(p.length(),po.length())*2);
} Scanner sc=new Scanner(System.in); sc new Scanner(System.in) String po=sc.next(); po sc.next() sc.next sc int length=po.length(); length po.length() po.length po String p=po.replace("1",""); p po.replace("1","") po.replace po "1" "" po=po.replace("0","") po po.replace("0","") po.replace po "0" "" System.out.println(Math.min(p.length(),po.length())*2) System.out.println System.out System System.out Math.min(p.length(),po.length())*2 Math.min(p.length(),po.length()) Math.min Math p.length() p.length p po.length() po.length po 2 String[]args args public class Main{
public static void main(String[]args){
Scanner sc=new Scanner(System.in);
  String po=sc.next();
  int length=po.length();
  String p=po.replace("1","");
  po=po.replace("0","");
  System.out.println(Math.min(p.length(),po.length())*2);
}
} public class Main{
public static void main(String[]args){
Scanner sc=new Scanner(System.in);
  String po=sc.next();
  int length=po.length();
  String p=po.replace("1","");
  po=po.replace("0","");
  System.out.println(Math.min(p.length(),po.length())*2);
}
} Main
import java.util.*;
public class Main{
public static void main(String[]args){
Scanner sc=new Scanner(System.in);
  String po=sc.next();
  int length=po.length();
  String p=po.replace("1","");
  po=po.replace("0","");
  System.out.println(Math.min(p.length(),po.length())*2);
}
}
