def main():
    s = input()
    a = s.count('0')
    b = s.count('1')
    print(len(s) - abs(a - b))       

if __name__ == '__main__':
    main() def main():
    s = input()
    a = s.count('0')
    b = s.count('1')
    print(len(s) - abs(a - b))        main s = input() s input() input a = s.count('0') a s.count('0') s.count s count '0' b = s.count('1') b s.count('1') s.count s count '1' print(len(s) - abs(a - b)) print len(s) - abs(a - b) len(s) len s abs(a - b) abs a - b a b if __name__ == '__main__':
    main() __name__ == '__main__' __name__ '__main__' main() main def main():
    s = input()
    a = s.count('0')
    b = s.count('1')
    print(len(s) - abs(a - b))        def main():
    s = input()
    a = s.count('0')
    b = s.count('1')
    print(len(s) - abs(a - b))        main
def main():
    s = input()
    a = s.count('0')
    b = s.count('1')
    print(len(s) - abs(a - b))       

if __name__ == '__main__':
    main()