

import java.util.Scanner;
import java.util.Stack;

public class Main {

	public static void main(String argsw[])
	{
		Scanner scan=new Scanner(System.in);
		Stack<Integer> stk=new Stack<Integer>();
		String eg=scan.next();
		long count=0;
		stk.add(eg.charAt(0)-'0');
		for(int i=1;i<eg.length();i++)
		{
			if( !stk.isEmpty() && (eg.charAt(i)-'0')!=stk.peek())
			{
				stk.pop();
				count+=2;
			}else {
				stk.add(eg.charAt(i)-'0');
			}
		}
		System.out.println(count);
	}
} import java.util.Scanner; Scanner java.util import java.util.Stack; Stack java.util public class Main {

	public static void main(String argsw[])
	{
		Scanner scan=new Scanner(System.in);
		Stack<Integer> stk=new Stack<Integer>();
		String eg=scan.next();
		long count=0;
		stk.add(eg.charAt(0)-'0');
		for(int i=1;i<eg.length();i++)
		{
			if( !stk.isEmpty() && (eg.charAt(i)-'0')!=stk.peek())
			{
				stk.pop();
				count+=2;
			}else {
				stk.add(eg.charAt(i)-'0');
			}
		}
		System.out.println(count);
	}
} Main public static void main(String argsw[])
	{
		Scanner scan=new Scanner(System.in);
		Stack<Integer> stk=new Stack<Integer>();
		String eg=scan.next();
		long count=0;
		stk.add(eg.charAt(0)-'0');
		for(int i=1;i<eg.length();i++)
		{
			if( !stk.isEmpty() && (eg.charAt(i)-'0')!=stk.peek())
			{
				stk.pop();
				count+=2;
			}else {
				stk.add(eg.charAt(i)-'0');
			}
		}
		System.out.println(count);
	} main {
		Scanner scan=new Scanner(System.in);
		Stack<Integer> stk=new Stack<Integer>();
		String eg=scan.next();
		long count=0;
		stk.add(eg.charAt(0)-'0');
		for(int i=1;i<eg.length();i++)
		{
			if( !stk.isEmpty() && (eg.charAt(i)-'0')!=stk.peek())
			{
				stk.pop();
				count+=2;
			}else {
				stk.add(eg.charAt(i)-'0');
			}
		}
		System.out.println(count);
	} Scanner scan=new Scanner(System.in); scan new Scanner(System.in) Stack<Integer> stk=new Stack<Integer>(); stk new Stack<Integer>() String eg=scan.next(); eg scan.next() scan.next scan long count=0; count 0 stk.add(eg.charAt(0)-'0') stk.add stk eg.charAt(0)-'0' eg.charAt(0) eg.charAt eg 0 '0' for(int i=1;i<eg.length();i++)
		{
			if( !stk.isEmpty() && (eg.charAt(i)-'0')!=stk.peek())
			{
				stk.pop();
				count+=2;
			}else {
				stk.add(eg.charAt(i)-'0');
			}
		} int i=1; int i=1; i 1 i<eg.length() i eg.length() eg.length eg i++ i++ i {
			if( !stk.isEmpty() && (eg.charAt(i)-'0')!=stk.peek())
			{
				stk.pop();
				count+=2;
			}else {
				stk.add(eg.charAt(i)-'0');
			}
		} {
			if( !stk.isEmpty() && (eg.charAt(i)-'0')!=stk.peek())
			{
				stk.pop();
				count+=2;
			}else {
				stk.add(eg.charAt(i)-'0');
			}
		} if( !stk.isEmpty() && (eg.charAt(i)-'0')!=stk.peek())
			{
				stk.pop();
				count+=2;
			}else {
				stk.add(eg.charAt(i)-'0');
			} !stk.isEmpty() && (eg.charAt(i)-'0')!=stk.peek() !stk.isEmpty() stk.isEmpty() stk.isEmpty stk (eg.charAt(i)-'0')!=stk.peek() (eg.charAt(i)-'0') eg.charAt(i) eg.charAt eg i '0' stk.peek() stk.peek stk {
				stk.pop();
				count+=2;
			} stk.pop() stk.pop stk count+=2 count 2 {
				stk.add(eg.charAt(i)-'0');
			} stk.add(eg.charAt(i)-'0') stk.add stk eg.charAt(i)-'0' eg.charAt(i) eg.charAt eg i '0' System.out.println(count) System.out.println System.out System System.out count String argsw[] argsw public class Main {

	public static void main(String argsw[])
	{
		Scanner scan=new Scanner(System.in);
		Stack<Integer> stk=new Stack<Integer>();
		String eg=scan.next();
		long count=0;
		stk.add(eg.charAt(0)-'0');
		for(int i=1;i<eg.length();i++)
		{
			if( !stk.isEmpty() && (eg.charAt(i)-'0')!=stk.peek())
			{
				stk.pop();
				count+=2;
			}else {
				stk.add(eg.charAt(i)-'0');
			}
		}
		System.out.println(count);
	}
} public class Main {

	public static void main(String argsw[])
	{
		Scanner scan=new Scanner(System.in);
		Stack<Integer> stk=new Stack<Integer>();
		String eg=scan.next();
		long count=0;
		stk.add(eg.charAt(0)-'0');
		for(int i=1;i<eg.length();i++)
		{
			if( !stk.isEmpty() && (eg.charAt(i)-'0')!=stk.peek())
			{
				stk.pop();
				count+=2;
			}else {
				stk.add(eg.charAt(i)-'0');
			}
		}
		System.out.println(count);
	}
} Main


import java.util.Scanner;
import java.util.Stack;

public class Main {

	public static void main(String argsw[])
	{
		Scanner scan=new Scanner(System.in);
		Stack<Integer> stk=new Stack<Integer>();
		String eg=scan.next();
		long count=0;
		stk.add(eg.charAt(0)-'0');
		for(int i=1;i<eg.length();i++)
		{
			if( !stk.isEmpty() && (eg.charAt(i)-'0')!=stk.peek())
			{
				stk.pop();
				count+=2;
			}else {
				stk.add(eg.charAt(i)-'0');
			}
		}
		System.out.println(count);
	}
}
