s=input()
s_list=list(s)
s_len=len(s_list)
div_list=[]
div_list.append(s_list[0])
s_list.pop(0)

while len(s_list) != 0:
  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)
    else:
      if first != second:
        div_list.append(first)
        div_list.append(second)
      else:
        div_list.append(first+second)
    s_list.pop(1)
    s_list.pop(0)

print(len(div_list))