S = str(input())

def del_cube(s, i):
    s = s[:i] + s[i+2:]
    return s

s = S
while True:
    flag = True
    for i in range(len(s) - 1):
        if s[i] == '0' and s[i+1] == '1' or s[i] == '1' and s[i+1] == '0':
            flag = False
            s = del_cube(s, i)
            break
            
    if flag == True:
        break
        
print(len(S) - len(s))
