
def r(s):
    bsl = len(s)
    flg = True
    while flg:
        b = s.replace('01', '').replace('10', '')
        if len(b) == len(s):
            flg = False
        else:
            s = b
    return bsl - len(s)


def main():
    input = sys.stdin.readline
    s = input().strip()

    print(r(s))


if __name__ == '__main__':
    main()
