S = list(input())

ans = 0

for i in range(2, len(S), 2):
    if S[i - 2] != S[i - 1]:
        ans += 2
    elif S[i - 1] != S[i]:
        ans += 2
        S[i] = S[i - 2]

if (len(S) - 1) % 2 != 0:
    if S[-2] != S[-1]:
        ans += 2
print(ans)
