s = input()
l = list(s)
s = list(s)

cnt = len(s)
i = 1
for index in l:
    if i >= len(l):
        break
    if s[i - 1] == s[i]:
        cnt -= 1
        i += 1
    i += 1

if(len(l) % 2 == 1):
    print(cnt)
else:
    print(cnt + 1)