def main():
    s = input()
    ss = s
    for i in range(len(s)//2):
        f = len(ss)
        ss = ss.replace("01", "").replace("10", "")
        if f == len(ss):
            break
    print(len(s)-len(ss))
    
if __name__ == "__main__":
    main()