# https://atcoder.jp/contests/agc037/tasks/agc037_a

s = input()

ans = 0
pre = s[0]
i = 0
while i < len(s):
    cur = s[i]
    if pre == cur:
        pre = s[i] + s[i]
        i += 2
    else:
        pre = cur
        i += 1
    ans += 1
print(ans)
