s = list(input())
def search(s):
    for i in range(len(s) - 1):
        if (int(s[i]) + int(s[i + 1])) % 2 == 1:
            #return s.replace(s[i]+s[i + 1], '', 1)
            s.pop(i)
            s.pop(i)
            return True
    return False

c = 0
while True:
    if not search(s):
        break
    else:
        c += 1

print(c * 2)