from collections import defaultdict
S=input()

N=len(S)

now=S[0]
ans=1

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