from sys import stdin
def S(): return stdin.readline().rstrip()

s = S()
ls = list(s)
l = []

tmp = ''
for i in range(len(ls)):
    if len(l)<1:
        l.append(ls.pop(0))
    else:
        tmp += ls.pop(0)
        if tmp != l[len(l)-1]:
            l.append(tmp)
            tmp = ''
        else:
            if i == len(l)-1:
                a = l.pop()
                l.append(a+tmp)

print(len(l))