s = input()
s2 = list(reversed(s))
def calc(s):
    i = 0
    ans = 0
    p = ""
    while True:
        if i >= len(s) - 1:
            return ans
        n = s[i]
        if p == n:
            n = s[i] + s[i+1]
            i += 1
        p = n
        i += 1
        ans += 1
print(max(calc(s), calc(s2)))
