s=input()
l=len(s)
S=str()

cnt=0
ck=0

for i in range(l):
    if ck==l-1:
        if s[ck]==S:
            break
        else:
            cnt+=1
        break
    if i==0:
        cnt=cnt+1
        S=s[0]
        ck+=1
        continue
    if s[ck]==S:
        S=s[ck]+s[ck+1]
        ck=ck+2
        cnt=cnt+1
        if ck==l-1 or ck==l:
            break
        else:
            continue
    if s[ck]!=S:
        S=s[ck]
        ck=ck+1
        cnt=cnt+1
        continue

print(cnt)