import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;

public class Main
{

  public static void main(String[] args) throws IOException
  {
    BufferedReader r = new BufferedReader(new InputStreamReader(System.in), 1);
    PrintWriter out = new PrintWriter(System.out);

    String s;
    String sl[];

    s = r.readLine();
    //sl = s.split(" ");

    int zeroes = 0;
    int ones = 0;
    int n = s.length();

    for(int i = 0; i < n; i++)
    {
      if(s.charAt(i) == '0')
      {
        zeroes++;
      }
      else
      {
        ones++;
      }
    }
    out.println(n - Math.abs(zeroes - ones));
    out.flush();
  }

} import java.io.BufferedReader; BufferedReader java.io import java.io.IOException; IOException java.io import java.io.InputStreamReader; InputStreamReader java.io import java.io.PrintWriter; PrintWriter java.io public class Main
{

  public static void main(String[] args) throws IOException
  {
    BufferedReader r = new BufferedReader(new InputStreamReader(System.in), 1);
    PrintWriter out = new PrintWriter(System.out);

    String s;
    String sl[];

    s = r.readLine();
    //sl = s.split(" ");

    int zeroes = 0;
    int ones = 0;
    int n = s.length();

    for(int i = 0; i < n; i++)
    {
      if(s.charAt(i) == '0')
      {
        zeroes++;
      }
      else
      {
        ones++;
      }
    }
    out.println(n - Math.abs(zeroes - ones));
    out.flush();
  }

} Main public static void main(String[] args) throws IOException
  {
    BufferedReader r = new BufferedReader(new InputStreamReader(System.in), 1);
    PrintWriter out = new PrintWriter(System.out);

    String s;
    String sl[];

    s = r.readLine();
    //sl = s.split(" ");

    int zeroes = 0;
    int ones = 0;
    int n = s.length();

    for(int i = 0; i < n; i++)
    {
      if(s.charAt(i) == '0')
      {
        zeroes++;
      }
      else
      {
        ones++;
      }
    }
    out.println(n - Math.abs(zeroes - ones));
    out.flush();
  } main {
    BufferedReader r = new BufferedReader(new InputStreamReader(System.in), 1);
    PrintWriter out = new PrintWriter(System.out);

    String s;
    String sl[];

    s = r.readLine();
    //sl = s.split(" ");

    int zeroes = 0;
    int ones = 0;
    int n = s.length();

    for(int i = 0; i < n; i++)
    {
      if(s.charAt(i) == '0')
      {
        zeroes++;
      }
      else
      {
        ones++;
      }
    }
    out.println(n - Math.abs(zeroes - ones));
    out.flush();
  } BufferedReader r = new BufferedReader(new InputStreamReader(System.in), 1); r new BufferedReader(new InputStreamReader(System.in), 1) PrintWriter out = new PrintWriter(System.out); out new PrintWriter(System.out) String s; s String sl[]; sl s = r.readLine() s r.readLine() r.readLine r int zeroes = 0; zeroes 0 int ones = 0; ones 0 int n = s.length(); n s.length() s.length s for(int i = 0; i < n; i++)
    {
      if(s.charAt(i) == '0')
      {
        zeroes++;
      }
      else
      {
        ones++;
      }
    } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
      if(s.charAt(i) == '0')
      {
        zeroes++;
      }
      else
      {
        ones++;
      }
    } {
      if(s.charAt(i) == '0')
      {
        zeroes++;
      }
      else
      {
        ones++;
      }
    } if(s.charAt(i) == '0')
      {
        zeroes++;
      }
      else
      {
        ones++;
      } s.charAt(i) == '0' s.charAt(i) s.charAt s i '0' {
        zeroes++;
      } zeroes++ zeroes {
        ones++;
      } ones++ ones out.println(n - Math.abs(zeroes - ones)) out.println out n - Math.abs(zeroes - ones) n Math.abs(zeroes - ones) Math.abs Math zeroes - ones zeroes ones out.flush() out.flush out String[] args args public class Main
{

  public static void main(String[] args) throws IOException
  {
    BufferedReader r = new BufferedReader(new InputStreamReader(System.in), 1);
    PrintWriter out = new PrintWriter(System.out);

    String s;
    String sl[];

    s = r.readLine();
    //sl = s.split(" ");

    int zeroes = 0;
    int ones = 0;
    int n = s.length();

    for(int i = 0; i < n; i++)
    {
      if(s.charAt(i) == '0')
      {
        zeroes++;
      }
      else
      {
        ones++;
      }
    }
    out.println(n - Math.abs(zeroes - ones));
    out.flush();
  }

} public class Main
{

  public static void main(String[] args) throws IOException
  {
    BufferedReader r = new BufferedReader(new InputStreamReader(System.in), 1);
    PrintWriter out = new PrintWriter(System.out);

    String s;
    String sl[];

    s = r.readLine();
    //sl = s.split(" ");

    int zeroes = 0;
    int ones = 0;
    int n = s.length();

    for(int i = 0; i < n; i++)
    {
      if(s.charAt(i) == '0')
      {
        zeroes++;
      }
      else
      {
        ones++;
      }
    }
    out.println(n - Math.abs(zeroes - ones));
    out.flush();
  }

} Main
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;

public class Main
{

  public static void main(String[] args) throws IOException
  {
    BufferedReader r = new BufferedReader(new InputStreamReader(System.in), 1);
    PrintWriter out = new PrintWriter(System.out);

    String s;
    String sl[];

    s = r.readLine();
    //sl = s.split(" ");

    int zeroes = 0;
    int ones = 0;
    int n = s.length();

    for(int i = 0; i < n; i++)
    {
      if(s.charAt(i) == '0')
      {
        zeroes++;
      }
      else
      {
        ones++;
      }
    }
    out.println(n - Math.abs(zeroes - ones));
    out.flush();
  }

}