S = input()
result = 0
before = ""
index = 0
for i in range(len(S)):
    if S[index] != before:
        before = S[index]
        index += 1
    else:
        before = ""
        index += 2
    result += 1
    if index >= len(S):
        print(result)
        break
