<?php
$stdin = trim(fgets(STDIN));
for ($i = 0; $i < strlen($stdin); ++$i) {
    $arr[] = substr($stdin, $i, 1);
}

$cnt = 0;

foreach ($arr as $k => $v) {
    if ($k > 0) {
        if (($key = isset_arr($arr, $k)) !== false) {
            if ($arr[$k] != $arr[$key]) {
                $cnt = $cnt + 2;
                unset($arr[$k]);
                unset($arr[$key]);
            }
        }
    }
}

function isset_arr($arr, $key)
{
    if (isset($arr[$key-1])) {
        return $key - 1;
    //} elseif ($key < 0) {
    //    return false;
    } else {
        return isset_arr($arr, $key-1);
    }
}

echo $cnt;