s = [i for i in input()]
 
result = 1
i = 0
while i < len(s)-1:
  if s[i] == s[i+1]:
    i = i + 2
  else:
    i = i + 1
  result = result + 1
  if i > len(s)-1:
    result = result - 1
    
print(result)