s=gets
prev=[0,1]
i=1
n=1
while i<s.size
  if prev[1]>1
    prev=[i,1]
    i+=1
  else
    if s[i-1].eql?(s[i])
      if i==s.size-1
        break
      else
        prev=[i,2]
        i+=2
      end
    else
      prev=[i,1]
      i+=1
    end
  end
  n+=1
end
puts n