# A - Dividing a String
import sys
input = sys.stdin.readline

S = input()
ans, prev, cur = 0, "", ""
for s in S:
  cur += s 
  if cur != prev: # True になるまで、curに文字列を追加していく
    ans += 1
    prev, cur = cur, ""

print(ans)