s=input()
cn=1
i=1
p=s[0]
while(i<len(s)):
  #print(p,s[i],i,end=" ")
  if(p==s[i]):
    #print(1)
    if(i+2<len(s)):
        cn+=1
        p=s[i]+s[i+1]
    else:
        break
    i+=2
  else:
    #print(2,s[i])
    cn+=1
    p=s[i]
    i+=1
    
print(cn)


    