import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
      Scanner sc = new Scanner(System.in);
      
      String s = sc.next();
      
      int n = 0;
      
      for(int i = 0; i <s.length(); i++){
        if(s.charAt(i) == '1'){
          n += 1;
        } else {
          n -= 1;
        }
      }
      
      System.out.println(s.length() - Math.abs(n));
          
      
    }
} import java.util.Scanner; Scanner java.util public class Main {
    public static void main(String[] args) {
      Scanner sc = new Scanner(System.in);
      
      String s = sc.next();
      
      int n = 0;
      
      for(int i = 0; i <s.length(); i++){
        if(s.charAt(i) == '1'){
          n += 1;
        } else {
          n -= 1;
        }
      }
      
      System.out.println(s.length() - Math.abs(n));
          
      
    }
} Main public static void main(String[] args) {
      Scanner sc = new Scanner(System.in);
      
      String s = sc.next();
      
      int n = 0;
      
      for(int i = 0; i <s.length(); i++){
        if(s.charAt(i) == '1'){
          n += 1;
        } else {
          n -= 1;
        }
      }
      
      System.out.println(s.length() - Math.abs(n));
          
      
    } main {
      Scanner sc = new Scanner(System.in);
      
      String s = sc.next();
      
      int n = 0;
      
      for(int i = 0; i <s.length(); i++){
        if(s.charAt(i) == '1'){
          n += 1;
        } else {
          n -= 1;
        }
      }
      
      System.out.println(s.length() - Math.abs(n));
          
      
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String s = sc.next(); s sc.next() sc.next sc int n = 0; n 0 for(int i = 0; i <s.length(); i++){
        if(s.charAt(i) == '1'){
          n += 1;
        } else {
          n -= 1;
        }
      } int i = 0; int i = 0; i 0 i <s.length() i s.length() s.length s i++ i++ i {
        if(s.charAt(i) == '1'){
          n += 1;
        } else {
          n -= 1;
        }
      } {
        if(s.charAt(i) == '1'){
          n += 1;
        } else {
          n -= 1;
        }
      } if(s.charAt(i) == '1'){
          n += 1;
        } else {
          n -= 1;
        } s.charAt(i) == '1' s.charAt(i) s.charAt s i '1' {
          n += 1;
        } n += 1 n 1 {
          n -= 1;
        } n -= 1 n 1 System.out.println(s.length() - Math.abs(n)) System.out.println System.out System System.out s.length() - Math.abs(n) s.length() s.length s Math.abs(n) Math.abs Math n String[] args args public class Main {
    public static void main(String[] args) {
      Scanner sc = new Scanner(System.in);
      
      String s = sc.next();
      
      int n = 0;
      
      for(int i = 0; i <s.length(); i++){
        if(s.charAt(i) == '1'){
          n += 1;
        } else {
          n -= 1;
        }
      }
      
      System.out.println(s.length() - Math.abs(n));
          
      
    }
} public class Main {
    public static void main(String[] args) {
      Scanner sc = new Scanner(System.in);
      
      String s = sc.next();
      
      int n = 0;
      
      for(int i = 0; i <s.length(); i++){
        if(s.charAt(i) == '1'){
          n += 1;
        } else {
          n -= 1;
        }
      }
      
      System.out.println(s.length() - Math.abs(n));
          
      
    }
} Main
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
      Scanner sc = new Scanner(System.in);
      
      String s = sc.next();
      
      int n = 0;
      
      for(int i = 0; i <s.length(); i++){
        if(s.charAt(i) == '1'){
          n += 1;
        } else {
          n -= 1;
        }
      }
      
      System.out.println(s.length() - Math.abs(n));
          
      
    }
}