#!/usr/bin/env python3
import sys

def solve(S: str):
    from collections import Counter
    c = Counter(S)
    return 2 * min(c["0"], c["1"])

# Generated by 1.1.7.1 https://github.com/kyuridenamida/atcoder-tools
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    S = next(tokens)  # type: str
    print(solve(S))

def test():
    import doctest
    doctest.testmod()

if __name__ == '__main__':
    #test()
    main() import sys sys def solve(S: str):
    from collections import Counter
    c = Counter(S)
    return 2 * min(c["0"], c["1"])

# Generated by 1.1.7.1 https://github.com/kyuridenamida/atcoder-tools solve from collections import Counter c = Counter(S) c Counter(S) Counter S return 2 * min(c["0"], c["1"]) 2 * min(c["0"], c["1"]) 2 min(c["0"], c["1"]) min c["0"] c "0" c["1"] c "1" S: str S def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    S = next(tokens)  # type: str
    print(solve(S)) main def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
     iterate_tokens for line in sys.stdin:
            for word in line.split():
                yield word
     line sys.stdin sys stdin for word in line.split():
                yield word
     word line.split() line.split line split yield word word tokens = iterate_tokens() tokens iterate_tokens() iterate_tokens S = next(tokens) S next(tokens) next tokens print(solve(S)) print solve(S) solve S def test():
    import doctest
    doctest.testmod() test import doctest doctest doctest.testmod() doctest.testmod doctest testmod if __name__ == '__main__':
    #test()
    main() __name__ == '__main__' __name__ '__main__' main() main def solve(S: str):
    from collections import Counter
    c = Counter(S)
    return 2 * min(c["0"], c["1"])

# Generated by 1.1.7.1 https://github.com/kyuridenamida/atcoder-tools def solve(S: str):
    from collections import Counter
    c = Counter(S)
    return 2 * min(c["0"], c["1"])

# Generated by 1.1.7.1 https://github.com/kyuridenamida/atcoder-tools solve def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    S = next(tokens)  # type: str
    print(solve(S)) def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    S = next(tokens)  # type: str
    print(solve(S)) main def test():
    import doctest
    doctest.testmod() def test():
    import doctest
    doctest.testmod() test
#!/usr/bin/env python3
import sys

def solve(S: str):
    from collections import Counter
    c = Counter(S)
    return 2 * min(c["0"], c["1"])

# Generated by 1.1.7.1 https://github.com/kyuridenamida/atcoder-tools
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    S = next(tokens)  # type: str
    print(solve(S))

def test():
    import doctest
    doctest.testmod()

if __name__ == '__main__':
    #test()
    main()
