S = input()

loop = True
index = 1
ans = 1
stmp = S[0]
while loop:
    if index == len(S):
        break
    stmp += S[index]
    if stmp == S[index - 1]:
        index += 1
        continue
    else:
        ans += 1
        index += 1
        stmp = ''
print(ans)