S = list(input())

a = S[0]
c = 1
while len(S) >1:
  if S[1] == a:
    if len(S) >2:
      a = S[1:3]
      S = [a] + S[3:]
      c += 1
    else:
      break
  else: 
    a = S[1]
    S = [a] + S[2:]
    c += 1
    
print(c)  