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



public class Main {

	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		String s = sc.next();
		Stack<Integer> stack = new Stack<Integer>();
		stack.push(s.charAt(0)-'0');
		int count =0;
		for(int i=1;i<s.length();i++) {
			if (stack.isEmpty()) {
				stack.push(s.charAt(i)-'0');
			} else {
				if (stack.peek()!=(s.charAt(i)-'0')) {
					stack.pop();
					count+=2;
				} else {
					stack.push(s.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[] args){
		Scanner sc = new Scanner(System.in);
		String s = sc.next();
		Stack<Integer> stack = new Stack<Integer>();
		stack.push(s.charAt(0)-'0');
		int count =0;
		for(int i=1;i<s.length();i++) {
			if (stack.isEmpty()) {
				stack.push(s.charAt(i)-'0');
			} else {
				if (stack.peek()!=(s.charAt(i)-'0')) {
					stack.pop();
					count+=2;
				} else {
					stack.push(s.charAt(i)-'0');
				}
			}
		}
		System.out.println(count);
	}
} Main public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		String s = sc.next();
		Stack<Integer> stack = new Stack<Integer>();
		stack.push(s.charAt(0)-'0');
		int count =0;
		for(int i=1;i<s.length();i++) {
			if (stack.isEmpty()) {
				stack.push(s.charAt(i)-'0');
			} else {
				if (stack.peek()!=(s.charAt(i)-'0')) {
					stack.pop();
					count+=2;
				} else {
					stack.push(s.charAt(i)-'0');
				}
			}
		}
		System.out.println(count);
	} main {
		Scanner sc = new Scanner(System.in);
		String s = sc.next();
		Stack<Integer> stack = new Stack<Integer>();
		stack.push(s.charAt(0)-'0');
		int count =0;
		for(int i=1;i<s.length();i++) {
			if (stack.isEmpty()) {
				stack.push(s.charAt(i)-'0');
			} else {
				if (stack.peek()!=(s.charAt(i)-'0')) {
					stack.pop();
					count+=2;
				} else {
					stack.push(s.charAt(i)-'0');
				}
			}
		}
		System.out.println(count);
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String s = sc.next(); s sc.next() sc.next sc Stack<Integer> stack = new Stack<Integer>(); stack new Stack<Integer>() stack.push(s.charAt(0)-'0') stack.push stack s.charAt(0)-'0' s.charAt(0) s.charAt s 0 '0' int count =0; count 0 for(int i=1;i<s.length();i++) {
			if (stack.isEmpty()) {
				stack.push(s.charAt(i)-'0');
			} else {
				if (stack.peek()!=(s.charAt(i)-'0')) {
					stack.pop();
					count+=2;
				} else {
					stack.push(s.charAt(i)-'0');
				}
			}
		} int i=1; int i=1; i 1 i<s.length() i s.length() s.length s i++ i++ i {
			if (stack.isEmpty()) {
				stack.push(s.charAt(i)-'0');
			} else {
				if (stack.peek()!=(s.charAt(i)-'0')) {
					stack.pop();
					count+=2;
				} else {
					stack.push(s.charAt(i)-'0');
				}
			}
		} {
			if (stack.isEmpty()) {
				stack.push(s.charAt(i)-'0');
			} else {
				if (stack.peek()!=(s.charAt(i)-'0')) {
					stack.pop();
					count+=2;
				} else {
					stack.push(s.charAt(i)-'0');
				}
			}
		} if (stack.isEmpty()) {
				stack.push(s.charAt(i)-'0');
			} else {
				if (stack.peek()!=(s.charAt(i)-'0')) {
					stack.pop();
					count+=2;
				} else {
					stack.push(s.charAt(i)-'0');
				}
			} stack.isEmpty() stack.isEmpty stack {
				stack.push(s.charAt(i)-'0');
			} stack.push(s.charAt(i)-'0') stack.push stack s.charAt(i)-'0' s.charAt(i) s.charAt s i '0' {
				if (stack.peek()!=(s.charAt(i)-'0')) {
					stack.pop();
					count+=2;
				} else {
					stack.push(s.charAt(i)-'0');
				}
			} if (stack.peek()!=(s.charAt(i)-'0')) {
					stack.pop();
					count+=2;
				} else {
					stack.push(s.charAt(i)-'0');
				} stack.peek()!=(s.charAt(i)-'0') stack.peek() stack.peek stack (s.charAt(i)-'0') s.charAt(i) s.charAt s i '0' {
					stack.pop();
					count+=2;
				} stack.pop() stack.pop stack count+=2 count 2 {
					stack.push(s.charAt(i)-'0');
				} stack.push(s.charAt(i)-'0') stack.push stack s.charAt(i)-'0' s.charAt(i) s.charAt s i '0' System.out.println(count) System.out.println System.out System System.out count String[] args args public class Main {

	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		String s = sc.next();
		Stack<Integer> stack = new Stack<Integer>();
		stack.push(s.charAt(0)-'0');
		int count =0;
		for(int i=1;i<s.length();i++) {
			if (stack.isEmpty()) {
				stack.push(s.charAt(i)-'0');
			} else {
				if (stack.peek()!=(s.charAt(i)-'0')) {
					stack.pop();
					count+=2;
				} else {
					stack.push(s.charAt(i)-'0');
				}
			}
		}
		System.out.println(count);
	}
} public class Main {

	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		String s = sc.next();
		Stack<Integer> stack = new Stack<Integer>();
		stack.push(s.charAt(0)-'0');
		int count =0;
		for(int i=1;i<s.length();i++) {
			if (stack.isEmpty()) {
				stack.push(s.charAt(i)-'0');
			} else {
				if (stack.peek()!=(s.charAt(i)-'0')) {
					stack.pop();
					count+=2;
				} else {
					stack.push(s.charAt(i)-'0');
				}
			}
		}
		System.out.println(count);
	}
} Main
import java.util.Scanner;
import java.util.Stack;



public class Main {

	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		String s = sc.next();
		Stack<Integer> stack = new Stack<Integer>();
		stack.push(s.charAt(0)-'0');
		int count =0;
		for(int i=1;i<s.length();i++) {
			if (stack.isEmpty()) {
				stack.push(s.charAt(i)-'0');
			} else {
				if (stack.peek()!=(s.charAt(i)-'0')) {
					stack.pop();
					count+=2;
				} else {
					stack.push(s.charAt(i)-'0');
				}
			}
		}
		System.out.println(count);
	}
}