import java.util.*;

public class Main {

  public static void main (String[] args) {

    Scanner sc = new Scanner(System.in);
    
    String S = sc.next();

    sc.close();

    String[] s = S.split("");

    int red = 0;
    int blue = 0;

    for (int i = 0; i < s.length; i++) {
      if(s[i].equals("0")){
        red++;
      } else {
        blue++;
      }
    }

    System.out.println(s.length - Math.abs(red - blue));

  }

} import java.util.*; util.* java public class Main {

  public static void main (String[] args) {

    Scanner sc = new Scanner(System.in);
    
    String S = sc.next();

    sc.close();

    String[] s = S.split("");

    int red = 0;
    int blue = 0;

    for (int i = 0; i < s.length; i++) {
      if(s[i].equals("0")){
        red++;
      } else {
        blue++;
      }
    }

    System.out.println(s.length - Math.abs(red - blue));

  }

} Main public static void main (String[] args) {

    Scanner sc = new Scanner(System.in);
    
    String S = sc.next();

    sc.close();

    String[] s = S.split("");

    int red = 0;
    int blue = 0;

    for (int i = 0; i < s.length; i++) {
      if(s[i].equals("0")){
        red++;
      } else {
        blue++;
      }
    }

    System.out.println(s.length - Math.abs(red - blue));

  } main {

    Scanner sc = new Scanner(System.in);
    
    String S = sc.next();

    sc.close();

    String[] s = S.split("");

    int red = 0;
    int blue = 0;

    for (int i = 0; i < s.length; i++) {
      if(s[i].equals("0")){
        red++;
      } else {
        blue++;
      }
    }

    System.out.println(s.length - Math.abs(red - blue));

  } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String S = sc.next(); S sc.next() sc.next sc sc.close() sc.close sc String[] s = S.split(""); s S.split("") S.split S "" int red = 0; red 0 int blue = 0; blue 0 for (int i = 0; i < s.length; i++) {
      if(s[i].equals("0")){
        red++;
      } else {
        blue++;
      }
    } int i = 0; int i = 0; i 0 i < s.length i s.length s s.length i++ i++ i {
      if(s[i].equals("0")){
        red++;
      } else {
        blue++;
      }
    } {
      if(s[i].equals("0")){
        red++;
      } else {
        blue++;
      }
    } if(s[i].equals("0")){
        red++;
      } else {
        blue++;
      } s[i].equals("0") s[i].equals s[i] s i "0" {
        red++;
      } red++ red {
        blue++;
      } blue++ blue System.out.println(s.length - Math.abs(red - blue)) System.out.println System.out System System.out s.length - Math.abs(red - blue) s.length s s.length Math.abs(red - blue) Math.abs Math red - blue red blue String[] args args public class Main {

  public static void main (String[] args) {

    Scanner sc = new Scanner(System.in);
    
    String S = sc.next();

    sc.close();

    String[] s = S.split("");

    int red = 0;
    int blue = 0;

    for (int i = 0; i < s.length; i++) {
      if(s[i].equals("0")){
        red++;
      } else {
        blue++;
      }
    }

    System.out.println(s.length - Math.abs(red - blue));

  }

} public class Main {

  public static void main (String[] args) {

    Scanner sc = new Scanner(System.in);
    
    String S = sc.next();

    sc.close();

    String[] s = S.split("");

    int red = 0;
    int blue = 0;

    for (int i = 0; i < s.length; i++) {
      if(s[i].equals("0")){
        red++;
      } else {
        blue++;
      }
    }

    System.out.println(s.length - Math.abs(red - blue));

  }

} Main
import java.util.*;

public class Main {

  public static void main (String[] args) {

    Scanner sc = new Scanner(System.in);
    
    String S = sc.next();

    sc.close();

    String[] s = S.split("");

    int red = 0;
    int blue = 0;

    for (int i = 0; i < s.length; i++) {
      if(s[i].equals("0")){
        red++;
      } else {
        blue++;
      }
    }

    System.out.println(s.length - Math.abs(red - blue));

  }

}