s = str(input())
leng_s = len(s)
count = 1
cur = s[0]
result = 1

while count < leng_s-1:
  if cur == s[count]:
    cur = s[count:count+2]
    count += 2
    result += 1
  else:
    cur = s[count]
    count += 1
    result += 1

if s[leng_s-2] != s[leng_s-1]:
  result += 1
  
print(result)