import sys

def divide(S, i, prv_S):
  tmp_S = ""
  for i in range(i,len(S)):
    tmp_S = tmp_S + S[i]
    if tmp_S != prv_S:
      return i+1, tmp_S
  return len(S)+1, None

S = sys.stdin.readline()
ans = 0
prv_S = None

# Sが一文字の時
if len(S) == 1:
  print(1)
  exit()

for i in range(len(S)):
  prv_S = S[i]
  index_S = i+1
  ans += 1
  #S2以降を決める
  while index_S < len(S):
    index_S, prv_S = divide(S, index_S, prv_S)
    ans += 1

  if index_S == len(S):
    print(ans)
    exit()
  else:
    ans = 0
    continue
  
print(ans)