S = input()
lst = [S[0]]
tmp = ''
for s in S[1:]:
    tmp += s
    if lst[-1] == tmp:
        continue
    else:
        lst.append(tmp)
        tmp = ''
# print(lst, tmp)
if tmp:
    while 1:
        tmp += lst.pop()
        if not lst or lst[-1] != tmp:
            lst.append(tmp)
            break
print(len(lst))