char_str = list(input())

ans = []
signal = True

for s in range(len(char_str)):
  if signal == True:
    if char_str[s] == char_str[s - 1]:
      ans.append(char_str[s] + char_str[s - 1])
      signal = False
    else:
      ans.append(char_str[s])
  else:
    signal = True

print(len(ans))