list=gets.chomp.split("");
i=1
num=0
count=0
list2=[list[i-1]]
while i<list.length do
  mozi=list[i]
  while list2[num]==mozi
    if i==list.length-1 then
    
    else
      mozi=mozi+list[i+1]
      i+=1
    end
  end
  list2.push(mozi)
  num+=1
  i+=1
end

puts list2.length