s = list(input())
for n in range(len(s)):
    s[n] = int(s[n])

count = 0
while(True):
    old = count
    if (len(s) == 1 or len(s) == 0):
        break

    for n in range(len(s) - 1):

        k = s[n]
        l = s[n + 1]

        if (k == l):
            s.pop(n)
            s.pop(n)

            count += 2
            break

    if (old == count):
        count += 2
        break

print(count)
