s = input()

def dp(sb, c_1):
  ret = ''
  for i,c in enumerate(sb):
    ret += c
    if c_1 != ret:
      return sb[i+1:], ret
  return False, False
    
sb = s
c_1 = ''
cnt = 0
while True:
  sb, c_1 = dp(sb, c_1)
  #print(c_1)
  if sb == False: 
    cnt += 1
    break
  cnt += 1
  if len(sb) == 0:
    break
print(cnt)