s=input()
s_list=list(s)
s_len=len(s_list)
count=0
div_list=[]

while len(s_list) != 0:
  if len(div_list)==0:
    div_list.append(s_list[0])
    s_list.pop(0)
  else:
    if len(s_list) == 1:
      if div_list[len(div_list)-1] != s_list[0]:
        div_list.append(s_list[0])
      s_list.pop(0)
    else:
      first = s_list[0]
      second = s_list[1]
      if div_list[len(div_list)-1] == first:
        div_list.append(first+second)
        s_list.pop(0)
        s_list.pop(0)
      else:
        if first != second:
          div_list.append(first)
          div_list.append(second)
        else:
          div_list.append(first+second)
        s_list.pop(0)
        s_list.pop(0)

print(len(div_list))