import sys 

sys.setrecursionlimit(1000000)
def dfs(s, i, count):
    #print(f"S_len: {len(s)}")
    if len(s) > 1 and len(s) - i > 1:
        current_cube = s[i]
        tmp_ans = 0 
        if (s[i] == "0" and s[i+1] == "1") or (s[i] == "1" and s[i+1] == "0"):
            b = s[:]
            del b[i]
            del b[i]
            tmp_ans = dfs(b, 0, count + 2)
        ans = dfs(s, i+1, count)
        #print(f"ans:{ans}")
        if ans < tmp_ans:
            ans = tmp_ans
        return ans 
    else: # 要素が0のとき
        return count 


S = list(input())
#print(S)

print(dfs(S, 0, 0))