s = input()
ans = 0

def solve(s):
    if all((s[i]==s[i+1] for i in range(len(s)-1))):
        return 0
    for i in range(len(s)-1):
        if s[i:i+2] == '01' or s[i:i+2] == '10':
            return solve(s[:i]+s[i+2:])+2

print(solve(s))