s = input()
k_list = []
cnt = 0
one = ""

for i in s:
  if len(k_list) == 0:
    k_list.append(i)
    cnt += 1
  elif k_list[cnt-1] == i:
    one += i
    pass
  else:
    k_list.append(one + i)
    one = ""
    cnt += 1
  
print(len(k_list))