import java.util.Scanner;

public class Main{
  static String str;
  static int N,zeroC,oneC;
  static int[] A;
  public static void main(String args[]){
    Scanner sc = new Scanner(System.in);
    str = sc.next();
    N = str.length();
    A = new int[N];
    for(int i=0;i<N;i++){
      A[i]=Character.getNumericValue(str.charAt(i));
      if(A[i]==0){
        zeroC++;
      }
      else{
        oneC++;
      }
    }
    System.out.println(N-(Math.abs(zeroC-oneC)));



  }


} import java.util.Scanner; Scanner java.util public class Main{
  static String str;
  static int N,zeroC,oneC;
  static int[] A;
  public static void main(String args[]){
    Scanner sc = new Scanner(System.in);
    str = sc.next();
    N = str.length();
    A = new int[N];
    for(int i=0;i<N;i++){
      A[i]=Character.getNumericValue(str.charAt(i));
      if(A[i]==0){
        zeroC++;
      }
      else{
        oneC++;
      }
    }
    System.out.println(N-(Math.abs(zeroC-oneC)));



  }


} Main static String str; str static int N N zeroC zeroC oneC; oneC static int[] A; A public static void main(String args[]){
    Scanner sc = new Scanner(System.in);
    str = sc.next();
    N = str.length();
    A = new int[N];
    for(int i=0;i<N;i++){
      A[i]=Character.getNumericValue(str.charAt(i));
      if(A[i]==0){
        zeroC++;
      }
      else{
        oneC++;
      }
    }
    System.out.println(N-(Math.abs(zeroC-oneC)));



  } main {
    Scanner sc = new Scanner(System.in);
    str = sc.next();
    N = str.length();
    A = new int[N];
    for(int i=0;i<N;i++){
      A[i]=Character.getNumericValue(str.charAt(i));
      if(A[i]==0){
        zeroC++;
      }
      else{
        oneC++;
      }
    }
    System.out.println(N-(Math.abs(zeroC-oneC)));



  } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) str = sc.next() str sc.next() sc.next sc N = str.length() N str.length() str.length str A = new int[N] A new int[N] N for(int i=0;i<N;i++){
      A[i]=Character.getNumericValue(str.charAt(i));
      if(A[i]==0){
        zeroC++;
      }
      else{
        oneC++;
      }
    } int i=0; int i=0; i 0 i<N i N i++ i++ i {
      A[i]=Character.getNumericValue(str.charAt(i));
      if(A[i]==0){
        zeroC++;
      }
      else{
        oneC++;
      }
    } {
      A[i]=Character.getNumericValue(str.charAt(i));
      if(A[i]==0){
        zeroC++;
      }
      else{
        oneC++;
      }
    } A[i]=Character.getNumericValue(str.charAt(i)) A[i] A i Character.getNumericValue(str.charAt(i)) Character.getNumericValue Character str.charAt(i) str.charAt str i if(A[i]==0){
        zeroC++;
      }
      else{
        oneC++;
      } A[i]==0 A[i] A i 0 {
        zeroC++;
      } zeroC++ zeroC {
        oneC++;
      } oneC++ oneC System.out.println(N-(Math.abs(zeroC-oneC))) System.out.println System.out System System.out N-(Math.abs(zeroC-oneC)) N (Math.abs(zeroC-oneC)) Math.abs Math zeroC-oneC zeroC oneC String args[] args public class Main{
  static String str;
  static int N,zeroC,oneC;
  static int[] A;
  public static void main(String args[]){
    Scanner sc = new Scanner(System.in);
    str = sc.next();
    N = str.length();
    A = new int[N];
    for(int i=0;i<N;i++){
      A[i]=Character.getNumericValue(str.charAt(i));
      if(A[i]==0){
        zeroC++;
      }
      else{
        oneC++;
      }
    }
    System.out.println(N-(Math.abs(zeroC-oneC)));



  }


} public class Main{
  static String str;
  static int N,zeroC,oneC;
  static int[] A;
  public static void main(String args[]){
    Scanner sc = new Scanner(System.in);
    str = sc.next();
    N = str.length();
    A = new int[N];
    for(int i=0;i<N;i++){
      A[i]=Character.getNumericValue(str.charAt(i));
      if(A[i]==0){
        zeroC++;
      }
      else{
        oneC++;
      }
    }
    System.out.println(N-(Math.abs(zeroC-oneC)));



  }


} Main
import java.util.Scanner;

public class Main{
  static String str;
  static int N,zeroC,oneC;
  static int[] A;
  public static void main(String args[]){
    Scanner sc = new Scanner(System.in);
    str = sc.next();
    N = str.length();
    A = new int[N];
    for(int i=0;i<N;i++){
      A[i]=Character.getNumericValue(str.charAt(i));
      if(A[i]==0){
        zeroC++;
      }
      else{
        oneC++;
      }
    }
    System.out.println(N-(Math.abs(zeroC-oneC)));



  }


}
