s = input()
N = len(s)
i = 0
count = 0
while i < N-1:
    if i == 0:
        word = s[i]
        i += 1
        count += 1
        last = 1
    if s[i-1] == s[i]:
        word = s[i:i+2]
        i += 2
        count += 1
        last = 2
    else:
        word = s[i]
        i += 1
        count += 1
        last = 1

if i+2 != N and ((last == 1 and word != s[N-1]) or last == 2):
    count += 1
print(count)