def solve(s):
    count = 0
    i = 0

    while True:
        if i >= len(s) - 1:
            break
        if s[i] != s[i + 1]:
            count += 1
            s = s[0:i] + s[i + 2:]
            i -= 1
            continue
        i += 1
    return count


def main():
    S = input()
    # a, b, k = [int(a) for a in input().split()]

    print(solve(S) * 2)


if __name__ == '__main__':
    main()
