S = input()

c = 0
j = 0
r = []
a=0
flg = False

for i in range(len(S)):
  if i == 0:
    r.append(S[i])
    if S[i] == S[i+1]:
      r[j] += S[i+1]
      flg = True
      continue
      
  if flg:
    flg = False
    continue
    
  if r[j] == S[i]:
    r.append(S[i]+S[i+1])
    j+=1
    flg = True
  else:
    r.append(S[i])
    j+=1
        
print(len(r))