import java.util.*;

public class Main{
  
  public static void main (String[] args){
    
    Main main = new Main();
    main.solve();
  }
  
  private void solve(){
    
    Scanner scanner = new Scanner (System.in);
    
    String S = scanner.nextLine();
    StringBuffer sb = new StringBuffer(S);
    int count = 0;
    
    for (int index=0; index<sb.length();index++){
      if (sb.charAt(index)=='1'){
        count++;
      } else {
        count--;
      }
    }
    
    System.out.println((sb.length()-(Math.abs(count))));
  }
} import java.util.*; util.* java public class Main{
  
  public static void main (String[] args){
    
    Main main = new Main();
    main.solve();
  }
  
  private void solve(){
    
    Scanner scanner = new Scanner (System.in);
    
    String S = scanner.nextLine();
    StringBuffer sb = new StringBuffer(S);
    int count = 0;
    
    for (int index=0; index<sb.length();index++){
      if (sb.charAt(index)=='1'){
        count++;
      } else {
        count--;
      }
    }
    
    System.out.println((sb.length()-(Math.abs(count))));
  }
} Main public static void main (String[] args){
    
    Main main = new Main();
    main.solve();
  } main {
    
    Main main = new Main();
    main.solve();
  } Main main = new Main(); main new Main() main.solve() main.solve main String[] args args private void solve(){
    
    Scanner scanner = new Scanner (System.in);
    
    String S = scanner.nextLine();
    StringBuffer sb = new StringBuffer(S);
    int count = 0;
    
    for (int index=0; index<sb.length();index++){
      if (sb.charAt(index)=='1'){
        count++;
      } else {
        count--;
      }
    }
    
    System.out.println((sb.length()-(Math.abs(count))));
  } solve {
    
    Scanner scanner = new Scanner (System.in);
    
    String S = scanner.nextLine();
    StringBuffer sb = new StringBuffer(S);
    int count = 0;
    
    for (int index=0; index<sb.length();index++){
      if (sb.charAt(index)=='1'){
        count++;
      } else {
        count--;
      }
    }
    
    System.out.println((sb.length()-(Math.abs(count))));
  } Scanner scanner = new Scanner (System.in); scanner new Scanner (System.in) String S = scanner.nextLine(); S scanner.nextLine() scanner.nextLine scanner StringBuffer sb = new StringBuffer(S); sb new StringBuffer(S) int count = 0; count 0 for (int index=0; index<sb.length();index++){
      if (sb.charAt(index)=='1'){
        count++;
      } else {
        count--;
      }
    } int index=0; int index=0; index 0 index<sb.length() index sb.length() sb.length sb index++ index++ index {
      if (sb.charAt(index)=='1'){
        count++;
      } else {
        count--;
      }
    } {
      if (sb.charAt(index)=='1'){
        count++;
      } else {
        count--;
      }
    } if (sb.charAt(index)=='1'){
        count++;
      } else {
        count--;
      } sb.charAt(index)=='1' sb.charAt(index) sb.charAt sb index '1' {
        count++;
      } count++ count {
        count--;
      } count-- count System.out.println((sb.length()-(Math.abs(count)))) System.out.println System.out System System.out (sb.length()-(Math.abs(count))) sb.length() sb.length sb (Math.abs(count)) Math.abs Math count public class Main{
  
  public static void main (String[] args){
    
    Main main = new Main();
    main.solve();
  }
  
  private void solve(){
    
    Scanner scanner = new Scanner (System.in);
    
    String S = scanner.nextLine();
    StringBuffer sb = new StringBuffer(S);
    int count = 0;
    
    for (int index=0; index<sb.length();index++){
      if (sb.charAt(index)=='1'){
        count++;
      } else {
        count--;
      }
    }
    
    System.out.println((sb.length()-(Math.abs(count))));
  }
} public class Main{
  
  public static void main (String[] args){
    
    Main main = new Main();
    main.solve();
  }
  
  private void solve(){
    
    Scanner scanner = new Scanner (System.in);
    
    String S = scanner.nextLine();
    StringBuffer sb = new StringBuffer(S);
    int count = 0;
    
    for (int index=0; index<sb.length();index++){
      if (sb.charAt(index)=='1'){
        count++;
      } else {
        count--;
      }
    }
    
    System.out.println((sb.length()-(Math.abs(count))));
  }
} Main
import java.util.*;

public class Main{
  
  public static void main (String[] args){
    
    Main main = new Main();
    main.solve();
  }
  
  private void solve(){
    
    Scanner scanner = new Scanner (System.in);
    
    String S = scanner.nextLine();
    StringBuffer sb = new StringBuffer(S);
    int count = 0;
    
    for (int index=0; index<sb.length();index++){
      if (sb.charAt(index)=='1'){
        count++;
      } else {
        count--;
      }
    }
    
    System.out.println((sb.length()-(Math.abs(count))));
  }
}