s = 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)
    return s

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

print(c * 2)