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[k]:
  ans[k]=ans[k]+S[-1]
else:
  ans.append(S[-1])

if S[0]==S[1]:
  ans2=[]
  ans2.append(S[0]+S[1])

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

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

#  print(ans)

#print(ans,ans2)
  
  
#print(ans)
print(max(len(ans),len(ans2)))