def reject(S, char, cnt):
    count = cnt
    if S.count(char) == 0:
        return count
    if S.count(char) > 0:
        index = S.find(char)
        S = S[:index] + S[index+2:]
        count += 2
    return max(reject(S,"01", count), reject(S,"10", count))

def main():
    S = input()
    print(max(reject(S,"01",0), reject(S,"10",0)))

main()
