def main():
    S = input()
    lengh_S = len(S)
    while True:
        if "01" in S or "10" in S:
            S = S.replace("01", "").replace("10", "")
        else:
            break
    print(lengh_S - len(S))


if __name__ == '__main__':
    main()