s = input().rstrip()
n = len(s)
res = 1
prev = s[0]
index = 1
while index < n:
    c = s[index]
    res += 1
    if c != prev:
        index += 1
        prev = c
    else:
        index += 2
        prev = ''
        if index >= n:
            res -= 1
print(res)