class Solver:

    def __init__(self):
        pass

    def solve(self, s):
        s0 = s
        while True:
            snew = s.replace('01','').replace('10','')
            if snew == s:
                return (len(s0) - len(snew))
            s = snew

if __name__ == '__main__':

    solver = Solver()

    s = input()

    n = solver.solve(s)
    print(n)
