s = input()
nokori = 0
streak = 1
temp = s[0]
for i in range(1,len(s)):
    if temp == s[i]:
        streak += 1
    else:
        if streak % 2 == 0:
            nokori += 0
        else:
            nokori += 1
        streak = 0

print(len(s) - nokori)