import java.util.LinkedList;
import java.util.Scanner;

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

  public int solve(String S) {
    ABC120CSolve abc120CSolve = new ABC120CSolve();
    return abc120CSolve.solve(S);
  }

  class ABC120CSolve {
    static final int ZERO = (int) '0';

    public int solve(String S) {
      int ans = 0;
      LinkedList<Integer> list = new LinkedList();

      for (char c : S.toCharArray()) {
        int i = (int) c - ZERO;
        if (list.size() == 0) {
          list.addLast(i);
        } else {
          if (list.getLast() != i) {
            list.removeLast();
            ans += 2;
          } else {
            list.addLast(i);
          }
        }
      }
      return ans;
    }
  }
} import java.util.LinkedList; LinkedList java.util 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();
    Main abc120C = new Main();
    System.out.println(abc120C.solve(S));
  }

  public int solve(String S) {
    ABC120CSolve abc120CSolve = new ABC120CSolve();
    return abc120CSolve.solve(S);
  }

  class ABC120CSolve {
    static final int ZERO = (int) '0';

    public int solve(String S) {
      int ans = 0;
      LinkedList<Integer> list = new LinkedList();

      for (char c : S.toCharArray()) {
        int i = (int) c - ZERO;
        if (list.size() == 0) {
          list.addLast(i);
        } else {
          if (list.getLast() != i) {
            list.removeLast();
            ans += 2;
          } else {
            list.addLast(i);
          }
        }
      }
      return ans;
    }
  }
} Main public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    String S = sc.next();
    Main abc120C = new Main();
    System.out.println(abc120C.solve(S));
  } main {
    Scanner sc = new Scanner(System.in);
    String S = sc.next();
    Main abc120C = new Main();
    System.out.println(abc120C.solve(S));
  } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String S = sc.next(); S sc.next() sc.next sc Main abc120C = new Main(); abc120C new Main() System.out.println(abc120C.solve(S)) System.out.println System.out System System.out abc120C.solve(S) abc120C.solve abc120C S String[] args args public int solve(String S) {
    ABC120CSolve abc120CSolve = new ABC120CSolve();
    return abc120CSolve.solve(S);
  } solve {
    ABC120CSolve abc120CSolve = new ABC120CSolve();
    return abc120CSolve.solve(S);
  } ABC120CSolve abc120CSolve = new ABC120CSolve(); abc120CSolve new ABC120CSolve() return abc120CSolve.solve(S); abc120CSolve.solve(S) abc120CSolve.solve abc120CSolve S String S S class ABC120CSolve {
    static final int ZERO = (int) '0';

    public int solve(String S) {
      int ans = 0;
      LinkedList<Integer> list = new LinkedList();

      for (char c : S.toCharArray()) {
        int i = (int) c - ZERO;
        if (list.size() == 0) {
          list.addLast(i);
        } else {
          if (list.getLast() != i) {
            list.removeLast();
            ans += 2;
          } else {
            list.addLast(i);
          }
        }
      }
      return ans;
    }
  } ABC120CSolve static final int ZERO = (int) '0'; ZERO (int) '0' public int solve(String S) {
      int ans = 0;
      LinkedList<Integer> list = new LinkedList();

      for (char c : S.toCharArray()) {
        int i = (int) c - ZERO;
        if (list.size() == 0) {
          list.addLast(i);
        } else {
          if (list.getLast() != i) {
            list.removeLast();
            ans += 2;
          } else {
            list.addLast(i);
          }
        }
      }
      return ans;
    } solve {
      int ans = 0;
      LinkedList<Integer> list = new LinkedList();

      for (char c : S.toCharArray()) {
        int i = (int) c - ZERO;
        if (list.size() == 0) {
          list.addLast(i);
        } else {
          if (list.getLast() != i) {
            list.removeLast();
            ans += 2;
          } else {
            list.addLast(i);
          }
        }
      }
      return ans;
    } int ans = 0; ans 0 LinkedList<Integer> list = new LinkedList(); list new LinkedList() for (char c : S.toCharArray()) {
        int i = (int) c - ZERO;
        if (list.size() == 0) {
          list.addLast(i);
        } else {
          if (list.getLast() != i) {
            list.removeLast();
            ans += 2;
          } else {
            list.addLast(i);
          }
        }
      } char c S.toCharArray() S.toCharArray S {
        int i = (int) c - ZERO;
        if (list.size() == 0) {
          list.addLast(i);
        } else {
          if (list.getLast() != i) {
            list.removeLast();
            ans += 2;
          } else {
            list.addLast(i);
          }
        }
      } {
        int i = (int) c - ZERO;
        if (list.size() == 0) {
          list.addLast(i);
        } else {
          if (list.getLast() != i) {
            list.removeLast();
            ans += 2;
          } else {
            list.addLast(i);
          }
        }
      } int i = (int) c - ZERO; i (int) c - ZERO (int) c ZERO if (list.size() == 0) {
          list.addLast(i);
        } else {
          if (list.getLast() != i) {
            list.removeLast();
            ans += 2;
          } else {
            list.addLast(i);
          }
        } list.size() == 0 list.size() list.size list 0 {
          list.addLast(i);
        } list.addLast(i) list.addLast list i {
          if (list.getLast() != i) {
            list.removeLast();
            ans += 2;
          } else {
            list.addLast(i);
          }
        } if (list.getLast() != i) {
            list.removeLast();
            ans += 2;
          } else {
            list.addLast(i);
          } list.getLast() != i list.getLast() list.getLast list i {
            list.removeLast();
            ans += 2;
          } list.removeLast() list.removeLast list ans += 2 ans 2 {
            list.addLast(i);
          } list.addLast(i) list.addLast list i return ans; ans String S S public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    String S = sc.next();
    Main abc120C = new Main();
    System.out.println(abc120C.solve(S));
  }

  public int solve(String S) {
    ABC120CSolve abc120CSolve = new ABC120CSolve();
    return abc120CSolve.solve(S);
  }

  class ABC120CSolve {
    static final int ZERO = (int) '0';

    public int solve(String S) {
      int ans = 0;
      LinkedList<Integer> list = new LinkedList();

      for (char c : S.toCharArray()) {
        int i = (int) c - ZERO;
        if (list.size() == 0) {
          list.addLast(i);
        } else {
          if (list.getLast() != i) {
            list.removeLast();
            ans += 2;
          } else {
            list.addLast(i);
          }
        }
      }
      return ans;
    }
  }
} public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    String S = sc.next();
    Main abc120C = new Main();
    System.out.println(abc120C.solve(S));
  }

  public int solve(String S) {
    ABC120CSolve abc120CSolve = new ABC120CSolve();
    return abc120CSolve.solve(S);
  }

  class ABC120CSolve {
    static final int ZERO = (int) '0';

    public int solve(String S) {
      int ans = 0;
      LinkedList<Integer> list = new LinkedList();

      for (char c : S.toCharArray()) {
        int i = (int) c - ZERO;
        if (list.size() == 0) {
          list.addLast(i);
        } else {
          if (list.getLast() != i) {
            list.removeLast();
            ans += 2;
          } else {
            list.addLast(i);
          }
        }
      }
      return ans;
    }
  }
} Main
import java.util.LinkedList;
import java.util.Scanner;

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

  public int solve(String S) {
    ABC120CSolve abc120CSolve = new ABC120CSolve();
    return abc120CSolve.solve(S);
  }

  class ABC120CSolve {
    static final int ZERO = (int) '0';

    public int solve(String S) {
      int ans = 0;
      LinkedList<Integer> list = new LinkedList();

      for (char c : S.toCharArray()) {
        int i = (int) c - ZERO;
        if (list.size() == 0) {
          list.addLast(i);
        } else {
          if (list.getLast() != i) {
            list.removeLast();
            ans += 2;
          } else {
            list.addLast(i);
          }
        }
      }
      return ans;
    }
  }
}
