string = input()
before = ""
flg = False
ans = 0
for i, s in enumerate(string):
    if flg:
        flg = False
        before = s
        continue
    elif s == before:
        if i == len(string) - 1:
            break
        flg = True
    ans += 1
    before = s
print(ans)