S = input()
stack = []
cnt = 0
for s in S:
    if not stack:
        stack.append(s)
    elif stack[-1] != s:
        stack.pop()
        cnt += 2
    else:
        stack.append(s)
print(cnt) S = input() S input() input stack = [] stack [] cnt = 0 cnt 0 for s in S:
    if not stack:
        stack.append(s)
    elif stack[-1] != s:
        stack.pop()
        cnt += 2
    else:
        stack.append(s) s S if not stack:
        stack.append(s)
    elif stack[-1] != s:
        stack.pop()
        cnt += 2
    else:
        stack.append(s) not stack stack stack.append(s) stack.append stack append s elif stack[-1] != s:
        stack.pop()
        cnt += 2
     stack[-1] != s stack[-1] stack -1 s stack.pop() stack.pop stack pop cnt += 2 cnt 2 stack.append(s) stack.append stack append s print(cnt) print cnt cnt = 0 0 cnt cnt += 2 2 cnt S = input() input() S stack = [] [] stack
S = input()
stack = []
cnt = 0
for s in S:
    if not stack:
        stack.append(s)
    elif stack[-1] != s:
        stack.pop()
        cnt += 2
    else:
        stack.append(s)
print(cnt)