S = input()
stack = []

cnt = 0
for s in S:
    if len(stack) == 0:
        stack.append(s)
    elif len(stack) > 0 and 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 len(stack) == 0:
        stack.append(s)
    elif len(stack) > 0 and stack[-1] != s:
        stack.pop()
        cnt += 2
    else:
        stack.append(s) s S if len(stack) == 0:
        stack.append(s)
    elif len(stack) > 0 and stack[-1] != s:
        stack.pop()
        cnt += 2
    else:
        stack.append(s) len(stack) == 0 len(stack) len stack 0 stack.append(s) stack.append stack append s elif len(stack) > 0 and stack[-1] != s:
        stack.pop()
        cnt += 2
     len(stack) > 0 and stack[-1] != s len(stack) > 0 len(stack) len stack 0 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 stack = [] [] stack cnt += 2 2 cnt cnt = 0 0 cnt S = input() input() S
S = input()
stack = []

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

print(cnt)