import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        String S = sc.next();
        int zeroCount = 0;
        int oneCount = 0;
        for (int i = 0; i < S.length(); i++) {
            if (S.charAt(i) == '1') {
                zeroCount++;
            } else {
                oneCount++;
            }
        }

        int notDeletedCount = Math.abs(zeroCount - oneCount);
        int res = S.length() - notDeletedCount;

        System.out.println(res);
    }
} 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 zeroCount = 0;
        int oneCount = 0;
        for (int i = 0; i < S.length(); i++) {
            if (S.charAt(i) == '1') {
                zeroCount++;
            } else {
                oneCount++;
            }
        }

        int notDeletedCount = Math.abs(zeroCount - oneCount);
        int res = S.length() - notDeletedCount;

        System.out.println(res);
    }
} Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        String S = sc.next();
        int zeroCount = 0;
        int oneCount = 0;
        for (int i = 0; i < S.length(); i++) {
            if (S.charAt(i) == '1') {
                zeroCount++;
            } else {
                oneCount++;
            }
        }

        int notDeletedCount = Math.abs(zeroCount - oneCount);
        int res = S.length() - notDeletedCount;

        System.out.println(res);
    } main {
        Scanner sc = new Scanner(System.in);

        String S = sc.next();
        int zeroCount = 0;
        int oneCount = 0;
        for (int i = 0; i < S.length(); i++) {
            if (S.charAt(i) == '1') {
                zeroCount++;
            } else {
                oneCount++;
            }
        }

        int notDeletedCount = Math.abs(zeroCount - oneCount);
        int res = S.length() - notDeletedCount;

        System.out.println(res);
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String S = sc.next(); S sc.next() sc.next sc int zeroCount = 0; zeroCount 0 int oneCount = 0; oneCount 0 for (int i = 0; i < S.length(); i++) {
            if (S.charAt(i) == '1') {
                zeroCount++;
            } else {
                oneCount++;
            }
        } 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') {
                zeroCount++;
            } else {
                oneCount++;
            }
        } {
            if (S.charAt(i) == '1') {
                zeroCount++;
            } else {
                oneCount++;
            }
        } if (S.charAt(i) == '1') {
                zeroCount++;
            } else {
                oneCount++;
            } S.charAt(i) == '1' S.charAt(i) S.charAt S i '1' {
                zeroCount++;
            } zeroCount++ zeroCount {
                oneCount++;
            } oneCount++ oneCount int notDeletedCount = Math.abs(zeroCount - oneCount); notDeletedCount Math.abs(zeroCount - oneCount) Math.abs Math zeroCount - oneCount zeroCount oneCount int res = S.length() - notDeletedCount; res S.length() - notDeletedCount S.length() S.length S notDeletedCount System.out.println(res) System.out.println System.out System System.out res String[] args args public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        String S = sc.next();
        int zeroCount = 0;
        int oneCount = 0;
        for (int i = 0; i < S.length(); i++) {
            if (S.charAt(i) == '1') {
                zeroCount++;
            } else {
                oneCount++;
            }
        }

        int notDeletedCount = Math.abs(zeroCount - oneCount);
        int res = S.length() - notDeletedCount;

        System.out.println(res);
    }
} public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        String S = sc.next();
        int zeroCount = 0;
        int oneCount = 0;
        for (int i = 0; i < S.length(); i++) {
            if (S.charAt(i) == '1') {
                zeroCount++;
            } else {
                oneCount++;
            }
        }

        int notDeletedCount = Math.abs(zeroCount - oneCount);
        int res = S.length() - notDeletedCount;

        System.out.println(res);
    }
} 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 zeroCount = 0;
        int oneCount = 0;
        for (int i = 0; i < S.length(); i++) {
            if (S.charAt(i) == '1') {
                zeroCount++;
            } else {
                oneCount++;
            }
        }

        int notDeletedCount = Math.abs(zeroCount - oneCount);
        int res = S.length() - notDeletedCount;

        System.out.println(res);
    }
}
