# coding=utf-8


def count_remove(cube_list):
    for i in range(len(cube_list)):
        try:
            if cube_list[i] != cube_list[i+1]:
                cube_list_n = cube_list[:i] + cube_list[i+2:]
                return 1 + count_remove(cube_list_n)
        except IndexError:
            return 0
    else:
        return 0


if __name__ == '__main__':
    S = list(map(int, input()))

    ctr = count_remove(S)
    print(ctr*2)
