s = input()


ex = []
ex.append(s[0])
cnt = 0
flag = 0
temp = 0
i = 1
while(i != len(s)):
  
  if((flag == 0 and ex[cnt] != s[i])or flag == 1):
    ex.append(s[i])
    cnt += 1
    flag = 0
    i+=1
  elif(flag == 0 and ex[cnt] != s[i]):
    ex.append(s[i:i+1])
    cnt+=1
    flag = 1
    i+=2
print(cnt)
    