s = input()
k=0
i=0
sec=0
while i < len(s)-1:
  if i==0:
    i+=1
    k+=1
  if sec==0:
    i+=1
    k+=1
    sec=1
  else:
    if s[i-1]==s[i]:
      i+=2
      k+=1
      sec=0
    else:
      i+=1
      k+=1
  
print(k)