s = input()
cnt = 0
pre_word = [""]
#print(s)
i = 1
over = 1
while s:
  if s[i:] == "":
    break
  if pre_word[-1] != s[0:i]:
    pre_word.append(s[0:i])
    s = s[i:]
    i = 0
    cnt += 1
  if s == "":
    break
  i+=1
print(cnt)