import java.util.*;
public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		//String tmp = sc.next();
		//int tmp = sc.nextInt();
		//Long tmp = sc.nextLong();
      String S = sc.next();
      int output = 0;
      int one = 0;
      int zero = 0;
      for(int i = 0; i < S.length(); i++){
        String tmp = S.substring(i , i + 1);
        if(tmp.equals("1")){
          if(zero > 0){
            //System.out.println("通過1");
            zero--;
            output += 2;
          }else{
            //System.out.println("通過2");
          	one++;
          }
        }else{
          if(one > 0){
            //System.out.println("通過3");
            one--;
            output += 2;
          }else{
            //System.out.println("通過4");
          	zero++;
          }
        }
      }
      System.out.println(output);
	}
} import java.util.*; util.* java public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		//String tmp = sc.next();
		//int tmp = sc.nextInt();
		//Long tmp = sc.nextLong();
      String S = sc.next();
      int output = 0;
      int one = 0;
      int zero = 0;
      for(int i = 0; i < S.length(); i++){
        String tmp = S.substring(i , i + 1);
        if(tmp.equals("1")){
          if(zero > 0){
            //System.out.println("通過1");
            zero--;
            output += 2;
          }else{
            //System.out.println("通過2");
          	one++;
          }
        }else{
          if(one > 0){
            //System.out.println("通過3");
            one--;
            output += 2;
          }else{
            //System.out.println("通過4");
          	zero++;
          }
        }
      }
      System.out.println(output);
	}
} Main public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		//String tmp = sc.next();
		//int tmp = sc.nextInt();
		//Long tmp = sc.nextLong();
      String S = sc.next();
      int output = 0;
      int one = 0;
      int zero = 0;
      for(int i = 0; i < S.length(); i++){
        String tmp = S.substring(i , i + 1);
        if(tmp.equals("1")){
          if(zero > 0){
            //System.out.println("通過1");
            zero--;
            output += 2;
          }else{
            //System.out.println("通過2");
          	one++;
          }
        }else{
          if(one > 0){
            //System.out.println("通過3");
            one--;
            output += 2;
          }else{
            //System.out.println("通過4");
          	zero++;
          }
        }
      }
      System.out.println(output);
	} main {
		Scanner sc = new Scanner(System.in);
		//String tmp = sc.next();
		//int tmp = sc.nextInt();
		//Long tmp = sc.nextLong();
      String S = sc.next();
      int output = 0;
      int one = 0;
      int zero = 0;
      for(int i = 0; i < S.length(); i++){
        String tmp = S.substring(i , i + 1);
        if(tmp.equals("1")){
          if(zero > 0){
            //System.out.println("通過1");
            zero--;
            output += 2;
          }else{
            //System.out.println("通過2");
          	one++;
          }
        }else{
          if(one > 0){
            //System.out.println("通過3");
            one--;
            output += 2;
          }else{
            //System.out.println("通過4");
          	zero++;
          }
        }
      }
      System.out.println(output);
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String S = sc.next(); S sc.next() sc.next sc int output = 0; output 0 int one = 0; one 0 int zero = 0; zero 0 for(int i = 0; i < S.length(); i++){
        String tmp = S.substring(i , i + 1);
        if(tmp.equals("1")){
          if(zero > 0){
            //System.out.println("通過1");
            zero--;
            output += 2;
          }else{
            //System.out.println("通過2");
          	one++;
          }
        }else{
          if(one > 0){
            //System.out.println("通過3");
            one--;
            output += 2;
          }else{
            //System.out.println("通過4");
          	zero++;
          }
        }
      } int i = 0; int i = 0; i 0 i < S.length() i S.length() S.length S i++ i++ i {
        String tmp = S.substring(i , i + 1);
        if(tmp.equals("1")){
          if(zero > 0){
            //System.out.println("通過1");
            zero--;
            output += 2;
          }else{
            //System.out.println("通過2");
          	one++;
          }
        }else{
          if(one > 0){
            //System.out.println("通過3");
            one--;
            output += 2;
          }else{
            //System.out.println("通過4");
          	zero++;
          }
        }
      } {
        String tmp = S.substring(i , i + 1);
        if(tmp.equals("1")){
          if(zero > 0){
            //System.out.println("通過1");
            zero--;
            output += 2;
          }else{
            //System.out.println("通過2");
          	one++;
          }
        }else{
          if(one > 0){
            //System.out.println("通過3");
            one--;
            output += 2;
          }else{
            //System.out.println("通過4");
          	zero++;
          }
        }
      } String tmp = S.substring(i , i + 1); tmp S.substring(i , i + 1) S.substring S i i + 1 i 1 if(tmp.equals("1")){
          if(zero > 0){
            //System.out.println("通過1");
            zero--;
            output += 2;
          }else{
            //System.out.println("通過2");
          	one++;
          }
        }else{
          if(one > 0){
            //System.out.println("通過3");
            one--;
            output += 2;
          }else{
            //System.out.println("通過4");
          	zero++;
          }
        } tmp.equals("1") tmp.equals tmp "1" {
          if(zero > 0){
            //System.out.println("通過1");
            zero--;
            output += 2;
          }else{
            //System.out.println("通過2");
          	one++;
          }
        } if(zero > 0){
            //System.out.println("通過1");
            zero--;
            output += 2;
          }else{
            //System.out.println("通過2");
          	one++;
          } zero > 0 zero 0 {
            //System.out.println("通過1");
            zero--;
            output += 2;
          } zero-- zero output += 2 output 2 {
            //System.out.println("通過2");
          	one++;
          } one++ one {
          if(one > 0){
            //System.out.println("通過3");
            one--;
            output += 2;
          }else{
            //System.out.println("通過4");
          	zero++;
          }
        } if(one > 0){
            //System.out.println("通過3");
            one--;
            output += 2;
          }else{
            //System.out.println("通過4");
          	zero++;
          } one > 0 one 0 {
            //System.out.println("通過3");
            one--;
            output += 2;
          } one-- one output += 2 output 2 {
            //System.out.println("通過4");
          	zero++;
          } zero++ zero System.out.println(output) System.out.println System.out System System.out output String[] args args public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		//String tmp = sc.next();
		//int tmp = sc.nextInt();
		//Long tmp = sc.nextLong();
      String S = sc.next();
      int output = 0;
      int one = 0;
      int zero = 0;
      for(int i = 0; i < S.length(); i++){
        String tmp = S.substring(i , i + 1);
        if(tmp.equals("1")){
          if(zero > 0){
            //System.out.println("通過1");
            zero--;
            output += 2;
          }else{
            //System.out.println("通過2");
          	one++;
          }
        }else{
          if(one > 0){
            //System.out.println("通過3");
            one--;
            output += 2;
          }else{
            //System.out.println("通過4");
          	zero++;
          }
        }
      }
      System.out.println(output);
	}
} public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		//String tmp = sc.next();
		//int tmp = sc.nextInt();
		//Long tmp = sc.nextLong();
      String S = sc.next();
      int output = 0;
      int one = 0;
      int zero = 0;
      for(int i = 0; i < S.length(); i++){
        String tmp = S.substring(i , i + 1);
        if(tmp.equals("1")){
          if(zero > 0){
            //System.out.println("通過1");
            zero--;
            output += 2;
          }else{
            //System.out.println("通過2");
          	one++;
          }
        }else{
          if(one > 0){
            //System.out.println("通過3");
            one--;
            output += 2;
          }else{
            //System.out.println("通過4");
          	zero++;
          }
        }
      }
      System.out.println(output);
	}
} Main
import java.util.*;
public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		//String tmp = sc.next();
		//int tmp = sc.nextInt();
		//Long tmp = sc.nextLong();
      String S = sc.next();
      int output = 0;
      int one = 0;
      int zero = 0;
      for(int i = 0; i < S.length(); i++){
        String tmp = S.substring(i , i + 1);
        if(tmp.equals("1")){
          if(zero > 0){
            //System.out.println("通過1");
            zero--;
            output += 2;
          }else{
            //System.out.println("通過2");
          	one++;
          }
        }else{
          if(one > 0){
            //System.out.println("通過3");
            one--;
            output += 2;
          }else{
            //System.out.println("通過4");
          	zero++;
          }
        }
      }
      System.out.println(output);
	}
}
