s = input()

former = s[0]
k = 1
idx = 1
while idx < len(s):
    if s[idx] != former:
        former = s[idx]
        idx += 1
    else:
        former = s[idx:idx+2]
        idx += 2
    k += 1

print(k)
