s = list(input())
count = 0
s_1 = s.copy()
i = 0
while i < len(s)-1:
    if s[i] != s[i+1]:
        del s[i]
        del s[i]
        count += 2
        i = 0
    else:
        i += 1
    print(s)
        


print(count)