
S=input()

N=len(S)

if N==1:
    print(1)
    exit()

if S[0]!=S[1]:
    pre=S[1]
    ans=2
else:
    pre=S[0]+S[1]
    ans=1

now=""
for i in range(2,N):
    s=S[i]
    now+=s
    if now!=pre:
        ans+=1
        pre=now
        now=""
        
    
        
print(ans)