S = input()
n = 0
i = 0
while i < len(S):
    # print(S)
    if len(set(S[i:i+2])) == 2:
        S = S[:i]+S[i+2:]
        n += 2
        if i != 0:
            i -= 1
    else:
        i += 1
print(n) S = input() S input() input n = 0 n 0 i = 0 i 0 while i < len(S):
    # print(S)
    if len(set(S[i:i+2])) == 2:
        S = S[:i]+S[i+2:]
        n += 2
        if i != 0:
            i -= 1
    else:
        i += 1 i < len(S) i len(S) len S if len(set(S[i:i+2])) == 2:
        S = S[:i]+S[i+2:]
        n += 2
        if i != 0:
            i -= 1
    else:
        i += 1 len(set(S[i:i+2])) == 2 len(set(S[i:i+2])) len set(S[i:i+2]) set S[i:i+2] S i:i+2 i i+2 i 2 2 S = S[:i]+S[i+2:] S S[:i]+S[i+2:] S[:i] S :i i S[i+2:] S i+2: i+2 i 2 n += 2 n 2 if i != 0:
            i -= 1
     i != 0 i 0 i -= 1 i 1 i += 1 i 1 print(n) print n i = 0 0 i S = input() input() S S = S[:i]+S[i+2:] S[:i]+S[i+2:] S i += 1 1 i i -= 1 1 i n = 0 0 n n += 2 2 n
S = input()
n = 0
i = 0
while i < len(S):
    # print(S)
    if len(set(S[i:i+2])) == 2:
        S = S[:i]+S[i+2:]
        n += 2
        if i != 0:
            i -= 1
    else:
        i += 1
print(n)