
import java.util.*;

import static java.lang.System.*;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String S = sc.next();
        List<Integer> list = new ArrayList<Integer>();

        for(int i = 0; i < S.length(); i++){
            list.add(Character.getNumericValue(S.charAt(i)));
        }


        int index = 0;
        int ans = 0;
        while(index < list.size() - 1){
            int num = list.get(index);
            int nextNum = list.get(index+1);
            if(num + nextNum == 1){   //01, 10の時
                ans += 2;
                list.remove(index);
                list.remove(index);  //連続で削除する
                index--;
                if(index < 0){ index = 0; }
            } else {
                index++;
            }
        }

        out.println(ans);
    }
} import java.util.*; util.* java import static java.lang.System.*; import static java.lang.System.*; import static java.lang.System.*; public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String S = sc.next();
        List<Integer> list = new ArrayList<Integer>();

        for(int i = 0; i < S.length(); i++){
            list.add(Character.getNumericValue(S.charAt(i)));
        }


        int index = 0;
        int ans = 0;
        while(index < list.size() - 1){
            int num = list.get(index);
            int nextNum = list.get(index+1);
            if(num + nextNum == 1){   //01, 10の時
                ans += 2;
                list.remove(index);
                list.remove(index);  //連続で削除する
                index--;
                if(index < 0){ index = 0; }
            } else {
                index++;
            }
        }

        out.println(ans);
    }
} Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String S = sc.next();
        List<Integer> list = new ArrayList<Integer>();

        for(int i = 0; i < S.length(); i++){
            list.add(Character.getNumericValue(S.charAt(i)));
        }


        int index = 0;
        int ans = 0;
        while(index < list.size() - 1){
            int num = list.get(index);
            int nextNum = list.get(index+1);
            if(num + nextNum == 1){   //01, 10の時
                ans += 2;
                list.remove(index);
                list.remove(index);  //連続で削除する
                index--;
                if(index < 0){ index = 0; }
            } else {
                index++;
            }
        }

        out.println(ans);
    } main {
        Scanner sc = new Scanner(System.in);
        String S = sc.next();
        List<Integer> list = new ArrayList<Integer>();

        for(int i = 0; i < S.length(); i++){
            list.add(Character.getNumericValue(S.charAt(i)));
        }


        int index = 0;
        int ans = 0;
        while(index < list.size() - 1){
            int num = list.get(index);
            int nextNum = list.get(index+1);
            if(num + nextNum == 1){   //01, 10の時
                ans += 2;
                list.remove(index);
                list.remove(index);  //連続で削除する
                index--;
                if(index < 0){ index = 0; }
            } else {
                index++;
            }
        }

        out.println(ans);
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String S = sc.next(); S sc.next() sc.next sc List<Integer> list = new ArrayList<Integer>(); list new ArrayList<Integer>() for(int i = 0; i < S.length(); i++){
            list.add(Character.getNumericValue(S.charAt(i)));
        } int i = 0; int i = 0; i 0 i < S.length() i S.length() S.length S i++ i++ i {
            list.add(Character.getNumericValue(S.charAt(i)));
        } {
            list.add(Character.getNumericValue(S.charAt(i)));
        } list.add(Character.getNumericValue(S.charAt(i))) list.add list Character.getNumericValue(S.charAt(i)) Character.getNumericValue Character S.charAt(i) S.charAt S i int index = 0; index 0 int ans = 0; ans 0 while(index < list.size() - 1){
            int num = list.get(index);
            int nextNum = list.get(index+1);
            if(num + nextNum == 1){   //01, 10の時
                ans += 2;
                list.remove(index);
                list.remove(index);  //連続で削除する
                index--;
                if(index < 0){ index = 0; }
            } else {
                index++;
            }
        } index < list.size() - 1 index list.size() - 1 list.size() list.size list 1 {
            int num = list.get(index);
            int nextNum = list.get(index+1);
            if(num + nextNum == 1){   //01, 10の時
                ans += 2;
                list.remove(index);
                list.remove(index);  //連続で削除する
                index--;
                if(index < 0){ index = 0; }
            } else {
                index++;
            }
        } int num = list.get(index); num list.get(index) list.get list index int nextNum = list.get(index+1); nextNum list.get(index+1) list.get list index+1 index 1 if(num + nextNum == 1){   //01, 10の時
                ans += 2;
                list.remove(index);
                list.remove(index);  //連続で削除する
                index--;
                if(index < 0){ index = 0; }
            } else {
                index++;
            } num + nextNum == 1 num + nextNum num nextNum 1 {   //01, 10の時
                ans += 2;
                list.remove(index);
                list.remove(index);  //連続で削除する
                index--;
                if(index < 0){ index = 0; }
            } ans += 2 ans 2 list.remove(index) list.remove list index list.remove(index) list.remove list index index-- index if(index < 0){ index = 0; } index < 0 index 0 { index = 0; } index = 0 index 0 {
                index++;
            } index++ index out.println(ans) out.println out ans String[] args args public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String S = sc.next();
        List<Integer> list = new ArrayList<Integer>();

        for(int i = 0; i < S.length(); i++){
            list.add(Character.getNumericValue(S.charAt(i)));
        }


        int index = 0;
        int ans = 0;
        while(index < list.size() - 1){
            int num = list.get(index);
            int nextNum = list.get(index+1);
            if(num + nextNum == 1){   //01, 10の時
                ans += 2;
                list.remove(index);
                list.remove(index);  //連続で削除する
                index--;
                if(index < 0){ index = 0; }
            } else {
                index++;
            }
        }

        out.println(ans);
    }
} public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String S = sc.next();
        List<Integer> list = new ArrayList<Integer>();

        for(int i = 0; i < S.length(); i++){
            list.add(Character.getNumericValue(S.charAt(i)));
        }


        int index = 0;
        int ans = 0;
        while(index < list.size() - 1){
            int num = list.get(index);
            int nextNum = list.get(index+1);
            if(num + nextNum == 1){   //01, 10の時
                ans += 2;
                list.remove(index);
                list.remove(index);  //連続で削除する
                index--;
                if(index < 0){ index = 0; }
            } else {
                index++;
            }
        }

        out.println(ans);
    }
} Main

import java.util.*;

import static java.lang.System.*;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String S = sc.next();
        List<Integer> list = new ArrayList<Integer>();

        for(int i = 0; i < S.length(); i++){
            list.add(Character.getNumericValue(S.charAt(i)));
        }


        int index = 0;
        int ans = 0;
        while(index < list.size() - 1){
            int num = list.get(index);
            int nextNum = list.get(index+1);
            if(num + nextNum == 1){   //01, 10の時
                ans += 2;
                list.remove(index);
                list.remove(index);  //連続で削除する
                index--;
                if(index < 0){ index = 0; }
            } else {
                index++;
            }
        }

        out.println(ans);
    }
}
