S = input()
ans = 1
now = S[0]
flag = False
for i in range(1, len(S)-1):
    if flag:
        flag = False
        continue
    if len(now) == 1:
        if S[i] == now:
            ans += 1
            now = S[i] + S[i+1]
            flag = True
        else:
            ans += 1
            now = S[i]
    else:
        ans += 1
        now = S[i]
if S[-1] != now:
    ans += 1
print(ans)