s = input()
ans = 1
tmp = s[0]
s = s[1:]
while True:
    if tmp == s[0]:
        if tmp != s[0:2]:
            ans += 1
        s = s[2:]
        tmp = s[0:2]
        if len(s) == 0:
            break
        ans += 1
    else:
        tmp = s[0]
        s = s[1:]
        ans += 1
        if len(s) == 0:
            break
    # print(s,tmp,ans)

print(ans)
