S=list(input())
#print(S)

#print(S[-1])

ans=[]
ans.append(S[0])

i=1
k=0
while i < len(S)-1:
#  print(i)
  if S[i]==ans[k]:
    ans.append(S[i]+S[i+1])
    i = i+2
    k=k+1
  else:
    ans.append(S[i])
    i = i+1
    k=k+1
#  print(ans)

if S[-1] == ans[-1]:
  ans[-1]=ans[-1]+S[-1]
else:
  ans.append(S[-1])

ans_len=len(ans)
if ans[-1]==ans[-2]:
  ans_len=ans_len-1
print(ans_len)
