S = input()

r=[]
flg = False
j=0

for i in range(len(S)):
  if not r:
    r.append(S[i])
    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))
