s = list(input())
ans_1 = 1
ans_2 = 1
i = 0
while i < len(s)-1:
  
  if i == len(s)-2 and s[i] == s[i+1]:
    break
    
  elif s[i] == s[i+1]:
    i += 2
    ans_1 += 1
  else:
    i += 1
    ans_1 +=1
    
k = 1
while k < len(s)-1:
  if s[k] == s[k+1]:
    k += 2
    ans_2 += 1
  else:
    k += 1
    ans_2 +=1
print(max(ans_1,ans_2))