import java.util.Scanner;

public class Main {
  public static void main(String args[]) {
    final Scanner scanner = new Scanner(System.in);
    final String input = scanner.next();
    final int count0 = countChar(input, '0');
    final int count1 = countChar(input, '1');
    System.out.println(input.length() - Math.abs(count0 - count1));
  }
  private static int countChar(String str, char target){
    return str.length() - str.replace(String.valueOf(target), "").length();
  }
} import java.util.Scanner; Scanner java.util public class Main {
  public static void main(String args[]) {
    final Scanner scanner = new Scanner(System.in);
    final String input = scanner.next();
    final int count0 = countChar(input, '0');
    final int count1 = countChar(input, '1');
    System.out.println(input.length() - Math.abs(count0 - count1));
  }
  private static int countChar(String str, char target){
    return str.length() - str.replace(String.valueOf(target), "").length();
  }
} Main public static void main(String args[]) {
    final Scanner scanner = new Scanner(System.in);
    final String input = scanner.next();
    final int count0 = countChar(input, '0');
    final int count1 = countChar(input, '1');
    System.out.println(input.length() - Math.abs(count0 - count1));
  } main {
    final Scanner scanner = new Scanner(System.in);
    final String input = scanner.next();
    final int count0 = countChar(input, '0');
    final int count1 = countChar(input, '1');
    System.out.println(input.length() - Math.abs(count0 - count1));
  } final Scanner scanner = new Scanner(System.in); scanner new Scanner(System.in) final String input = scanner.next(); input scanner.next() scanner.next scanner final int count0 = countChar(input, '0'); count0 countChar(input, '0') countChar input '0' final int count1 = countChar(input, '1'); count1 countChar(input, '1') countChar input '1' System.out.println(input.length() - Math.abs(count0 - count1)) System.out.println System.out System System.out input.length() - Math.abs(count0 - count1) input.length() input.length input Math.abs(count0 - count1) Math.abs Math count0 - count1 count0 count1 String args[] args private static int countChar(String str, char target){
    return str.length() - str.replace(String.valueOf(target), "").length();
  } countChar {
    return str.length() - str.replace(String.valueOf(target), "").length();
  } return str.length() - str.replace(String.valueOf(target), "").length(); str.length() - str.replace(String.valueOf(target), "").length() str.length() str.length str str.replace(String.valueOf(target), "").length() str.replace(String.valueOf(target), "").length str.replace(String.valueOf(target), "") str.replace str String.valueOf(target) String.valueOf String target "" String str str char target target public class Main {
  public static void main(String args[]) {
    final Scanner scanner = new Scanner(System.in);
    final String input = scanner.next();
    final int count0 = countChar(input, '0');
    final int count1 = countChar(input, '1');
    System.out.println(input.length() - Math.abs(count0 - count1));
  }
  private static int countChar(String str, char target){
    return str.length() - str.replace(String.valueOf(target), "").length();
  }
} public class Main {
  public static void main(String args[]) {
    final Scanner scanner = new Scanner(System.in);
    final String input = scanner.next();
    final int count0 = countChar(input, '0');
    final int count1 = countChar(input, '1');
    System.out.println(input.length() - Math.abs(count0 - count1));
  }
  private static int countChar(String str, char target){
    return str.length() - str.replace(String.valueOf(target), "").length();
  }
} Main
import java.util.Scanner;

public class Main {
  public static void main(String args[]) {
    final Scanner scanner = new Scanner(System.in);
    final String input = scanner.next();
    final int count0 = countChar(input, '0');
    final int count1 = countChar(input, '1');
    System.out.println(input.length() - Math.abs(count0 - count1));
  }
  private static int countChar(String str, char target){
    return str.length() - str.replace(String.valueOf(target), "").length();
  }
}