s = input()

ans = 0
i = 0

while i<len(s)-1:
    if s[i] != s[i+1]:
        ans += 1
        i += 1
        if i == len(s)-1:
            ans += 1
            break
    else:
        if i+2 <= len(s)-1:
            ans += 2
            i += 3
        else:
            ans += 1
            break

print(ans)