// Undone
using System;
using System.Linq;
using System.Collections.Generic;
using System.Collections;
public class Program {
  public static void Main() {
    List<int> S = ReadCharIntArray().ToList();
    int count = 0;
    for (int i = 0; i < S.Count()-1; i++) {
      if (i < 0) i = 0;
      if (S.All(x => x == 0) || S.All(x => x == 1)) break;
      if ((S[i] == 1 && S[i+1] == 0) || (S[i] == 0 && S[i+1] == 1)) {
        S.RemoveAt(i);
        S.RemoveAt(i);
        i -= 2;
        count += 2;
      }
    }
    Console.WriteLine(count);
  }

  private static string ReadStr() { return Console.ReadLine(); }
  private static int ReadInt() { return int.Parse(Console.ReadLine()); }
  private static double ReadDouble() { return double.Parse(Console.ReadLine()); }
  private static long ReadLong() { return long.Parse(Console.ReadLine()); }
  private static char ReadChar() { return Console.ReadLine()[0]; }
  private static string[] ReadStringArray() { return Console.ReadLine().Split(' '); }
  private static int[] ReadIntArray() { return Console.ReadLine().Split(' ').Select(int.Parse).ToArray(); }
  private static double[] ReadDoubleArray() { return Console.ReadLine().Split(' ').Select(double.Parse).ToArray(); }
  private static long[] ReadLongArray() { return Console.ReadLine().Split(' ').Select(long.Parse).ToArray(); }
  private static char[] ReadCharArray() { return Console.ReadLine().ToArray(); }
  private static string[] ReadCharStringArray() { return Console.ReadLine().ToCharArray().Select(c => c.ToString()).ToArray(); }
  private static int[] ReadCharIntArray() { return Console.ReadLine().ToCharArray().Select(c => int.Parse(c.ToString())).ToArray(); }
}
