cmax=0
def crmv(c,istr):
    if len(istr)<=1:
        return c
    if not('1' in istr) or not('0' in istr):
        return c

    rv=0
    for i in range(len(istr)-1):
        if istr[i] != istr[i+1]:
            tstr=istr[:i]+istr[i+1+1:]
            r=crmv(c+2,tstr)
            if r>rv:
                rv=r
    return rv

istr=input()
print(crmv(0,istr))