import sys
input = lambda: sys.stdin.readline().rstrip()

def main():
    s = list(input())
    ans = 0
    while(True):
        if s == [] or len(s) == 1:
            print(ans*2)
            return
        for i in range(1, len(s)):
            if (s[i-1]=='0' and s[i]=='1') or (s[i-1]=='1' and s[i]=='0'):
                ans += 1
                s.pop(i)
                s.pop(i-1)
                break
            if i == len(s)-1:
                print(ans*2)
                return
        
if __name__ == '__main__':
    main()