import sys
from operator import itemgetter
import collections


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

    return bsl - len(s)


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

    print(r(s))


if __name__ == '__main__':
    main()
