s = input()

ans = 1
t = True
b = True
for i in range(1, len(s)):
    if s[i] == s[i - 1] and t:
        if b:
            b = False
            ans += 1
        else: 
            t = False
    elif not t:
        ans += 1
        t = True
    else:
        ans += 1
        b = False

print(ans)
    