string = input()
temp = ""
last = ""
count = 0
for s in string:
    temp += s
    if last != s:
        count += 1
        last = temp
        temp = ""
if temp != "" and temp != last:
    count += 1

print(count)