S = list(input())

ans = 0
prev = S[0]

skip = False

prev = '2'

i=0
while i < len(S)-1:
    if not prev == S[i]:
        ans += 2
        if prev == '2':
            prev = S[i-1]
        i += 2 
    else:
        i += 1

print(ans)