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);
  }

} import java.util.*; util.* java 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);
  }

} 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);
  } main {
    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);
  } Scanner scn = new Scanner(System.in); scn new Scanner(System.in) char[] S = scn.nextLine().toCharArray(); S scn.nextLine().toCharArray() scn.nextLine().toCharArray scn.nextLine() scn.nextLine scn ArrayList<Character> Slist = new ArrayList<>(); Slist new ArrayList<>() for (Character ch : S) {
      Slist.add(ch);
    } Character ch S {
      Slist.add(ch);
    } {
      Slist.add(ch);
    } Slist.add(ch) Slist.add Slist ch int count = 0; count 0 int i = 0; 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++;
      }

    } i < Slist.size() - 1 i Slist.size() - 1 Slist.size() Slist.size Slist 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++;
      }

    } String chunk = Slist.get(i).toString() + Slist.get(i + 1).toString(); chunk Slist.get(i).toString() + Slist.get(i + 1).toString() Slist.get(i).toString() Slist.get(i).toString Slist.get(i) Slist.get Slist i Slist.get(i + 1).toString() Slist.get(i + 1).toString Slist.get(i + 1) Slist.get Slist i + 1 i 1 if (chunk.equals("10") || chunk.equals("01")) {
        count += 2;
        Slist.remove(i);
        Slist.remove(i);
        i = (i - 1 < 0) ? 0 : --i;
      } else {
        i++;
      } chunk.equals("10") || chunk.equals("01") chunk.equals("10") chunk.equals chunk "10" chunk.equals("01") chunk.equals chunk "01" {
        count += 2;
        Slist.remove(i);
        Slist.remove(i);
        i = (i - 1 < 0) ? 0 : --i;
      } count += 2 count 2 Slist.remove(i) Slist.remove Slist i Slist.remove(i) Slist.remove Slist i i = (i - 1 < 0) ? 0 : --i i (i - 1 < 0) ? 0 : --i (i - 1 < 0) i - 1 i 1 0 0 --i i {
        i++;
      } i++ i System.out.println(count) System.out.println System.out System System.out count String[] args args 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);
  }

} 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);
  }

} Main
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);
  }

}
