s=input()
cnt=0
flg=0
while flg==0:
    i=0
    if len(s)<2:
        break
    for i in range(len(s)-1):
            if s[i]!=s[i+1]:
                s=(s[:i])+(s[i+2:])
                print(s)
                cnt+=2
                break
            if i==len(s)-2:
                flg=1
                break
print(cnt)