S = str(input())
S = list(S)
print(S)

count = 0
"""
i = 0
while len(list(set(S))) != 1:
    if S[i] == S[i+1]:
        del S[i]
        del S[i+1]
        count += 2
        """
        if len(S) == 0:
            print(count)
            exit()
        """
    i += 1
    if i == len(S)-1:
        print(count)
        exit()
print(count)
"""

while len(list(set(S))) != 1:
    for i in range(len(S)-1):
        if S[i] == S[i+1]:
            del S[i]
            del S[i+1]
            count += 2
            if len(S) == 0:
                print(count)
                exit()
        break

print(count)
