import java.util.Scanner;
import java.util.ArrayList;

public class Main {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        System.out.println(solve(in.nextLine()));
    }
    public static int solve(String S) {
        return Math.min(count(S, "0"), count(S, "1")) * 2;
    }
    public static int count(String s, String sub) {
        int res = 0;
        String cur = new String(s);
        while (true) {
            int pos = cur.indexOf(sub);
            if (pos == -1) {
                return res;
            }
            res++;
            cur = cur.substring(pos + sub.length());
        }
    }
} import java.util.Scanner; Scanner java.util import java.util.ArrayList; ArrayList java.util public class Main {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        System.out.println(solve(in.nextLine()));
    }
    public static int solve(String S) {
        return Math.min(count(S, "0"), count(S, "1")) * 2;
    }
    public static int count(String s, String sub) {
        int res = 0;
        String cur = new String(s);
        while (true) {
            int pos = cur.indexOf(sub);
            if (pos == -1) {
                return res;
            }
            res++;
            cur = cur.substring(pos + sub.length());
        }
    }
} Main public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        System.out.println(solve(in.nextLine()));
    } main {
        Scanner in = new Scanner(System.in);
        System.out.println(solve(in.nextLine()));
    } Scanner in = new Scanner(System.in); in new Scanner(System.in) System.out.println(solve(in.nextLine())) System.out.println System.out System System.out solve(in.nextLine()) solve in.nextLine() in.nextLine in String[] args args public static int solve(String S) {
        return Math.min(count(S, "0"), count(S, "1")) * 2;
    } solve {
        return Math.min(count(S, "0"), count(S, "1")) * 2;
    } return Math.min(count(S, "0"), count(S, "1")) * 2; Math.min(count(S, "0"), count(S, "1")) * 2 Math.min(count(S, "0"), count(S, "1")) Math.min Math count(S, "0") count S "0" count(S, "1") count S "1" 2 String S S public static int count(String s, String sub) {
        int res = 0;
        String cur = new String(s);
        while (true) {
            int pos = cur.indexOf(sub);
            if (pos == -1) {
                return res;
            }
            res++;
            cur = cur.substring(pos + sub.length());
        }
    } count {
        int res = 0;
        String cur = new String(s);
        while (true) {
            int pos = cur.indexOf(sub);
            if (pos == -1) {
                return res;
            }
            res++;
            cur = cur.substring(pos + sub.length());
        }
    } int res = 0; res 0 String cur = new String(s); cur new String(s) while (true) {
            int pos = cur.indexOf(sub);
            if (pos == -1) {
                return res;
            }
            res++;
            cur = cur.substring(pos + sub.length());
        } true {
            int pos = cur.indexOf(sub);
            if (pos == -1) {
                return res;
            }
            res++;
            cur = cur.substring(pos + sub.length());
        } int pos = cur.indexOf(sub); pos cur.indexOf(sub) cur.indexOf cur sub if (pos == -1) {
                return res;
            } pos == -1 pos -1 1 {
                return res;
            } return res; res res++ res cur = cur.substring(pos + sub.length()) cur cur.substring(pos + sub.length()) cur.substring cur pos + sub.length() pos sub.length() sub.length sub String s s String sub sub public class Main {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        System.out.println(solve(in.nextLine()));
    }
    public static int solve(String S) {
        return Math.min(count(S, "0"), count(S, "1")) * 2;
    }
    public static int count(String s, String sub) {
        int res = 0;
        String cur = new String(s);
        while (true) {
            int pos = cur.indexOf(sub);
            if (pos == -1) {
                return res;
            }
            res++;
            cur = cur.substring(pos + sub.length());
        }
    }
} public class Main {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        System.out.println(solve(in.nextLine()));
    }
    public static int solve(String S) {
        return Math.min(count(S, "0"), count(S, "1")) * 2;
    }
    public static int count(String s, String sub) {
        int res = 0;
        String cur = new String(s);
        while (true) {
            int pos = cur.indexOf(sub);
            if (pos == -1) {
                return res;
            }
            res++;
            cur = cur.substring(pos + sub.length());
        }
    }
} Main
import java.util.Scanner;
import java.util.ArrayList;

public class Main {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        System.out.println(solve(in.nextLine()));
    }
    public static int solve(String S) {
        return Math.min(count(S, "0"), count(S, "1")) * 2;
    }
    public static int count(String s, String sub) {
        int res = 0;
        String cur = new String(s);
        while (true) {
            int pos = cur.indexOf(sub);
            if (pos == -1) {
                return res;
            }
            res++;
            cur = cur.substring(pos + sub.length());
        }
    }
}
