s = input()
pr = s[0]
cnt = 0
i = 0
while i < len(s)-1:
    if len(pr) == 1:
        if s[i+1] == pr:
            if i+2 < len(s)-1:
                cnt += 1
                pr = s[i+1:i+3]
                i += 2
            else:
                break
        else:
            cnt += 1
            pr = s[i+1]
            i += 1
    else:
        cnt += 1
        pr = s[i+2]
        i += 1
print(cnt+1)