def main():
    S = input()
    d = {'0': 0, '1': 0}
    for s in S:
        d[s] += 1
    print(min(d.values()) * 2)


if __name__ == '__main__':
    main() def main():
    S = input()
    d = {'0': 0, '1': 0}
    for s in S:
        d[s] += 1
    print(min(d.values()) * 2) main S = input() S input() input d = {'0': 0, '1': 0} d {'0': 0, '1': 0} '0' '0' 0 '1' '1' 0 for s in S:
        d[s] += 1
     s S d[s] += 1 d[s] d s 1 print(min(d.values()) * 2) print min(d.values()) * 2 min(d.values()) min d.values() d.values d values 2 if __name__ == '__main__':
    main() __name__ == '__main__' __name__ '__main__' main() main def main():
    S = input()
    d = {'0': 0, '1': 0}
    for s in S:
        d[s] += 1
    print(min(d.values()) * 2) def main():
    S = input()
    d = {'0': 0, '1': 0}
    for s in S:
        d[s] += 1
    print(min(d.values()) * 2) main
def main():
    S = input()
    d = {'0': 0, '1': 0}
    for s in S:
        d[s] += 1
    print(min(d.values()) * 2)


if __name__ == '__main__':
    main()
