import java.util.*;

public class Main {
  public static void main(String[] args) {
    Scanner scn = new Scanner(System.in);
    char[] S = scn.nextLine().toCharArray();
    ArrayList<Character> Slist = new ArrayList<>();
    for (Character ch : S) {
      Slist.add(ch);
    }

    int count = 0;
    int i = 0;
    while (i < Slist.size() - 1) {
      String chunk = Slist.get(i).toString() + Slist.get(i + 1).toString();

      if (chunk.equals("10") || chunk.equals("01")) {
        count += 2;
        Slist.remove(i);
        Slist.remove(i);
        i = (i - 1 < 0) ? 0 : --i;
      } else {
        i++;
      }

    }

    System.out.println(count);
  }

}

/tmp/hf-datasets-cache/medium/datasets/42704881117311-config-parquet-and-info-qiankunmu-Project_CodeNet-896c9d36/hub/datasets--qiankunmu--Project_CodeNet_Python800_and_Java250/snapshots/c899fde44a77ba1cc14973ed3de064e4ff3aadc7/Project_CodeNet_Java250.tar.gz