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