#!/usr/bin/env python3
import sys


def solve(S: str):
    ans = 0
    if S == '0':
        print(ans)
        return
    N = len(S)
    for i in range(min(S.count('0'), S.count('1'))):
        if len(S) > 0:
            S = S.replace('10', '')
            S = S.replace('01', '')
        else:
            break
    ans = N - len(S)
    print(ans)
# Generated by 1.1.6 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    S = str(next(tokens))  # type: str
    solve(S)

if __name__ == '__main__':
    main()
