#! /usr/bin/env python3
# -*- coding: utf-8 -*-

S = input()
ls = list(S)
ls = [int(x) for x in ls]
offset = 0
count = 0
while len(ls) >= 2:
    if ls[offset] != ls[offset +1]:
        del ls[offset:offset +2]
        count += 2
        offset = 0
    elif offset + 1 == len(ls):
        break
    else:
        offset += 1

print(count)